About 2,180,000 results
Open links in new tab
  1. Java: How to square a number - alvinalexander.com

    Jul 30, 2024 · You can square a number in Java in at least two different ways: Multiply the number by itself; Call the Math.pow function; The following examples demonstrate these …

  2. Java Math Class - GeeksforGeeks

    Jul 24, 2024 · Java.lang.Math Class methods help to perform numeric operations like square, square root, cube, cube root, exponential and trigonometric operations. Declaration. public …

  3. How to Square a Number in Java? - JavaBeat

    Dec 30, 2023 · To square a number, built-in and user-defined functions can be used. The built-in methods include “ Math. pow () ” and “ mulitplyExact () ”. On the other hand, the user-defined …

  4. Calculate square of a number without using *, / and pow()

    Mar 9, 2015 · Given an integer n, calculate the square of a number without using *, / and pow(). Examples : Input: n = 5 Output: 25 Input: 7 Output: 49 Input: n = 12 Output: 144

  5. How to Square a Number in Java - CodeGym

    Apr 30, 2021 · There are different ways of computing the square of a number in Java, but let’s start with the simplest method. Have a look at the following example for better understanding. …

  6. How to Square a Number in Java: A Step-by-Step Guide - Code …

    Feb 11, 2024 · We’re going to leverage Java’s Math.pow() method to calculate the square of our number. This method takes two parameters: the base (our number) and the exponent (2 for …

  7. How to Compute Square in Java [Practical Examples]

    Aug 25, 2022 · There are four different ways to compute square of a number in Java, Using multiplication operator *, Using Math.pow() function, Using BigInteger.pow() function, Using …

  8. Java - How to find Square of a Number - Techndeck

    Jul 22, 2020 · Java: How to square a number. You can square a number in Java in two different ways: Multiply the number by itself or Call the Math.pow() function...

  9. Squares in Java | Examples of the Squares in Java - EDUCBA

    Let us learn how to calculate square in java: The simplest way of finding the square of a number is Math.pow (), where it can be used to calculate any power of a number. Code: Output:

  10. Java Program to Find Square of a Number - Tutorial Gateway

    Write a Java Program to find Square of a Number using methods with example. This Java program allows the user to enter an integer value. Then this Java program calculates the …

  11. Some results have been removed