Computer Science, asked by sudishreddy4466, 6 months ago

write a java program using if else statement to find the greater number

Answers

Answered by honeyajeesh2017
0

Explanation:

Java program to find largest among 2 numbers

import java.util.scanner;

class number

{

public static void main;

{

int a, b, biggest;

Scanner sc = new Scanner (System.in);

a = sc . nextInt( );

b = sc. nextInt( );

if (a>b)

{

biggest = a;

}

else

{

biggest = b;

}

system.out.println(" largest among two numbers is " +biggest);

}

}

Similar questions