//https://csprograms4u.blogspot.com/
//Chapter 2
//Program 2
//Use of If Else Statement in Java
import
java.util.Scanner;
public
class IfElse
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n;
System.out.println("Enter
age");
n=sc.nextInt();
if(n>=18)
{
System.out.println("Person is
eligible to vote");
}
else
{
System.out.println("Person is
not eligible to vote");
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.