You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// program to check if the age is greater than 18classconditional{
publicstaticvoidmain(){
intage = 20;
if (age > 18){
System.out.Println("Age is greater than 18");
}
}
}
Write a program to find greatest of two numbers using if...else
// Program to find greatest of two numberclassGreater{
publicstaticvoidmain(Stringargs[]){
inta = 10;
intb = 20;
if (a > b){
System.out.println("a is greater");
} else {
System.out.println("b is greater");
}
}
}
Programs ToDo
Write a program to find greatest of 3 numbers using nested if...else...
Write a program to find greatest of 3 numbers using else if ladder