Professional Documents
Culture Documents
(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
(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
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.