hello plz help me
how to solve this question in java programming
write a method (and the calling statement) to compute the square of a number
Printable View
hello plz help me
how to solve this question in java programming
write a method (and the calling statement) to compute the square of a number
To compute square number you only need the number squared - i.e. multiplied by itself.
Are you sure it is your problem?
Perhaps you meant "Square Root"?
There is a ready method Math.sqrt(x)...
If you want to calculate it without library methods you can use either "Babylonyan method" - you can find comprehensive description here:
Wiki: Square Root Approximation - CodeAbbey
Or you can even use binary search.
Please show some effort, then describe what you need help with, what you don't understand, errors received, etc. THEN we can help.