45 IF - ELSE CONTROL STATEMENT

 package com.cnc;

public class Main {
public static void main(String[] args) {
int male = 32;
int female = 70;
if(male < 18){
System.out.println("An child boy");
}
else if (male >= 18 && male<=60){
System.out.println("An adult boy");
}
else {
System.out.println("An old man");
}
if(female < 18){
System.out.println("An child girl");
}
else if (female >= 18 && female<=60){
System.out.println("An adult girl");
}
else {
System.out.println("An old woman");
}
}
}




Popular posts from this blog

NUMBER PALINDROME CHALLENGE

ENCAPSULATION CHALLENGE

LARGEST PRIME FACTOR OF A NUMBER