write a program to accept a number. print its square and cube
Answers
Answered by
1
Answer:
class ex2
{
public static void main (int n)
{
int s, c;
s=n*n;
c=n*n*n
System. out. println ("square="+s) ;
System. out. print ("cube="+c) ;
}
}
Similar questions
Computer Science,
1 month ago
English,
1 month ago
History,
2 months ago
English,
2 months ago
Computer Science,
9 months ago
Math,
9 months ago
Biology,
9 months ago