package CoreJava;
import java.util.Scanner;
public class javaCore {
public static void main (String [] args) {
//this is main function
Scanner scan = new Scanner(System.in);
int age = scan.nextInt();
if (age > 18) {
System.out.print("You are eligible for vote");
}
else if (age == 100) {
System.out.print("You are out dated");
}
else if (age < 18) {
System.out.println("You are not eligible for Vote");
}
//this is called ladder
// else lag gya to ladder khtm
}
}
Yaha agr ham else ka statement lga dete hai to ye ladder nhi kehlayega
ladder sirf if se else if tk hota hai
Comments
Post a Comment