To check greatest of three numbers in java

CODE :

public class P_03_greatest_3_no_part2 {
public static void main(String[] args) {
int a=1,b=2,c=3;
if (a>b && a>c) {
System.out.println("A is greatest");
}
else if (b>c && b>a) {
System.out.println("B is greatest");
}
else{
System.out.println("C is greatest");
}
}
}

Output :


Comments

Popular posts from this blog

Program to illustrate the concept of templates.

To create an html file to implement the concept of margin, padding using cascading style sheets.

To configure the IP address for a computer connected to LAN