Computer Science, asked by aashi486, 11 months ago

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 brainlytopper1
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