How to Square a Number in Java

We can square a number in Java in no less than two different ways. Let have a look on each method one by one. Method1: Multiplying the Number by Itself To square a number x, we can multiply the number by itself. Y = x * x. Java Program for the above method.

Output: …

How to Square a Number in Java Read More »