Computer Science, asked by umeshkesharwani599, 5 months ago

write a program to find out the person is eligivle to vote or not.​

Answers

Answered by himanshu2006vps
1

Answer:

A person can votes if age is greater than or equal to 18.

import java.util.Scanner;

public class VotingAge

{

public static void main(String[] args)

{

int age;

Scanner sc = new Scanner(System.in);

System.out.print("Enter your age=");

age = sc.nextInt();

if (age >= 18)

{

System.out.println("You are eligible for vote.");

}

else

{

System.out.println("You are not eligible for vote.");

}

}

}

Answered by kumarsnehit7
0

Explanation:

hope it helps you

it is given in my book

Attachments:
Similar questions