input 4 numbers in java and find the greater number without using If Else
Answers
Answered by
2
import java.util.Scanner;
class number
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,b,c,d;
System.out.println("enter the value of number");
a=in.nextInt();
b=in.nextInt();
c=in.nextInt();
d=in.nextInt();
System.out.println("the first number is="+a);
System.out.println("the second number is="+b);
System.out.println("the third number is="+c);
System.out.println("the fourth number is="+d);
}
}
class number
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,b,c,d;
System.out.println("enter the value of number");
a=in.nextInt();
b=in.nextInt();
c=in.nextInt();
d=in.nextInt();
System.out.println("the first number is="+a);
System.out.println("the second number is="+b);
System.out.println("the third number is="+c);
System.out.println("the fourth number is="+d);
}
}
abhishek1764:
please bro mark me as a brainliest
Similar questions