Write a program in java to input an number and display its square if it is less than 50 else display it’s cube
Answers
Answered by
6
YOUR ANSWER:
class Number
{
public static void main(int num)
{
if(num<50)
{
int square=num*num;
System.out.println("The square of the _. number is "+square);
}
else
{
int cube=num*num*num;
System.out.println("The cube of the _. number is "+cube);
}
}
}
hope it helps plz plz mark as brainiest
.....
Similar questions
Math,
5 months ago
English,
5 months ago
Environmental Sciences,
11 months ago
English,
11 months ago
Science,
1 year ago
CBSE BOARD XII,
1 year ago
Math,
1 year ago