Computer Science, asked by MannVats, 1 month ago

write a program to enter the number and perform the following square of the number cube of the entered number, number to the power 25, square root of the number and the absolute value of the entered number

Answers

Answered by kajalprasad323
0

Answer:

In this program, we are using these two methods of Math class:

Math.pow(m,n):

It is used to get the power of any base, it will return m to the power of n (m^n).

Math.sqrt(m):

It is used to get the square root of any number, it will return square root of

Answered by Equestriadash
2

The following c‎odes have been written using Python.

\tt n\ =\ int(in put("Enter\ a\ number:\ "))\\print()\\print(n* *2,\ "is\ the\ square\ of\ the\ number.")\\print(n* *3,\ "is\ the\ cube\ of\ the\ number.")\\print(n* *25,\ "is\ the\ result\ of\ the\ number\ raised\ to\ 25.")\\print(n* *(1/2),\ "is\ the\ square\ root\ of\ the\ number.")\\print(abs(n),\ "is\ the\ absolute\ value\ of\ the\ number.")

Once the number has been entered, the tasks as per the question are performed. Exponentiation is represented using double asterisks (*‎*). Python has a built-in fu‎nction to print the absolute value of a number, called \tt abs(). The syntax is as follows:

\bf abs(number)

The absolute value of a number is the number irrespective of its sign, i.e., negative or positive.

Similar questions