import java.util.*;
class sqorcube{
public static void main(String [] args){
int a ,sq=0,cube=0;
Scanner inp =new Scanner(System.in);
System.out.println("Enter number");
a=inp.nextInt();
if(a%2==0)
{
System.out.println("even"+sq);
sq=a*a;
System.out.println("Square"+sq);
}
else
{
System.out.println("odd");
cube=a*a*a;
System.out.println("cube:="+cube);
}
}
}
class sqorcube{
public static void main(String [] args){
int a ,sq=0,cube=0;
Scanner inp =new Scanner(System.in);
System.out.println("Enter number");
a=inp.nextInt();
if(a%2==0)
{
System.out.println("even"+sq);
sq=a*a;
System.out.println("Square"+sq);
}
else
{
System.out.println("odd");
cube=a*a*a;
System.out.println("cube:="+cube);
}
}
}
No comments:
Post a Comment