0% found this document useful (0 votes)
49 views2 pages

(A) Write A C Program To Find The Eligibility of A Person To Vote or Not? EX - NO:2a Date: Programs Using Decision-Making Constructs

The program asks for a person's name and age and determines if they are eligible to vote based on being at least 18 years old or not. It outputs whether the person is eligible or not eligible to vote based on their age.

Uploaded by

5109 GIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

(A) Write A C Program To Find The Eligibility of A Person To Vote or Not? EX - NO:2a Date: Programs Using Decision-Making Constructs

The program asks for a person's name and age and determines if they are eligible to vote based on being at least 18 years old or not. It outputs whether the person is eligible or not eligible to vote based on their age.

Uploaded by

5109 GIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

(a)Write a C Program to Find the Eligibility of a Person to Vote or Not?

EX.NO:2a PROGRAMS USING DECISION-MAKING CONSTRUCTS

DATE:

AIM:
To Write a C Program to find the eligibility of a Person to Vote or not?

ALGORITHM:
1.Start the program.
2.Read name, age.
3.IF age>=18 print “Eligible”.
4.ELSE print “Not Eligible”.
5.ENDIF.
6.Stop the Program.

PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
int age;
char name[50]; // or *name
clrscr();
printf("\n Type the Name of the candidate: ");
gets(name);
printf("\n Enter The Age : ");
scanf("%d",&age);
if(age>=18)
printf("\n %s is Eligible for Vote",name);
else
printf("\n %s is Not Eligible for Vote",name);
getch();
}
RESULT:
Thus the program to find the eligibility of a Person to Vote or not was executed and the
output was verified.

You might also like