Computer Science, asked by zarlishkhan207, 11 months ago

To calculate the square and cube of any number

Answers

Answered by ashutosh217
0

square=multiply the number by itself ex 2×2=4

cube=multiply the number three times 3×3×3=27

Answered by Vyomsingh
1

Answer:

In java.

class number

{

void main (int n)

{

int s=(int)Math.pow (n,2);

int c=(int)Matheson.pow (n,3);

System.out.println(s+" "+c);

}

}

Explanation:

Similar questions