Computer Science, asked by anssj, 1 year ago

write a simple program to enter two unequal numbers .If the first number is greater than display square of the smallest number and cube of the greater number otherwise vice versa

Answers

Answered by jahaan80
32
import java.util.Scanner;
class abc
{
public static void main(Steing[]args)
{
int x;
int y;
Scanner obj=new Scanner(System.in);
System.out.println("Enter the first number");
x=obj.nextInt();
System.out.println("Entet the second number");
y=obj.nextInt();
{
if(x>y)
System.out.println("Sq. of smaller number is + x × x");
System.out.println("Cube of greater number is + y×y×y")

else
System.out.println("sq. of greater number is + y×y");
System.out.println("cube of smaller number is + x×x×x");
}
}
}
Similar questions