This Java program defines integer variables a, b, and c and assigns them values of 20, 10, and 30, respectively. It then uses if/else if/else statements to compare the values and print which variable holds the largest number, with the output indicating that c is largest since it was assigned a value of 30.
This Java program defines integer variables a, b, and c and assigns them values of 20, 10, and 30, respectively. It then uses if/else if/else statements to compare the values and print which variable holds the largest number, with the output indicating that c is largest since it was assigned a value of 30.
This Java program defines integer variables a, b, and c and assigns them values of 20, 10, and 30, respectively. It then uses if/else if/else statements to compare the values and print which variable holds the largest number, with the output indicating that c is largest since it was assigned a value of 30.
public static void main(String args[]){ int a=20,b=10,c=30; if(a>b && a>c){ System.out.println("A is largest no"); } else if(b>a && b>c){ System.out.println("B is largest no"); } else{ System.out.println("C is largest no"); } } }