0
how to create area of square using double
3 Réponses
+ 2
Area of a square is side^2. Create a double variable, we'll call it side and another one we'll call area. Then you can either times it by itself, or use Math.pow. Example, double side = 5. double area = side * side or double area = Math.pow(side, 2).
+ 1
you can use any of the two ways
either return side^2
or return math.pow(side,2)
where "side" is a double variable
0
Thank You James and Hardik.. it's working , double area = Math.pow(side,2)
thank you James✌✌