Friday, May 29, 2015

If....Condition


public class IfCondition {

// LOOPS AND CONDITIONAL SYATEMENTS

public static void main(String[] args) {

int age = 18;

System.out.println("\n---------------------IF...CONDITION---------------------------------");

// if....condition
if (age == 18) {
System.out.println("Eligible to vote from this year");
}else if( age < 18){
System.out.println("Not eligible to vote");
}else{
System.out.println("Eligible to vote");
}
}
}


No comments:

Post a Comment