Accept A Number and Check Whether The Number Is Even or Odd
Accept A Number and Check Whether The Number Is Even or Odd
Accept name and age and display whether the person is eligible to caste vote
or not.
import java.util.*;
public class q2
{
public static void main(String args[])
{
String name;
int age;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the name : ");
name=sc.nextLine();
System.out.println("Enter age");
age=sc.nextInt();
if(age>=18)
System.out.println(name+" is elligible to caste vote");
else
System.out.println(name+" is not elligible to caste vote");
}
}