Accept the age of a person. Display the message Eligible For Role if the age is equal to or greater than 18, otherwise display the message Not Eligible.
make a flowchart.
Answers
Answered by
4
Refer the attached image for the flow chart.
Explanation:
Algorithm:
Step 1: Start
Step 2: Read the value of age of the person.
Step 3: If age is greater than or equal to 18, display 'You are eligible to vote'.
Step 4: If age is less than 18 or else, display 'You are not eligible to vote'.
Step 5: Stop
Program:
#include <stdio.h>
int main() {
int age;
printf("Enter the age of the person: ");
scanf("%d",&age);
if(age>=18)
{
printf("You are eligible to vote.");
}
else
{
printf("You are not eligible to vote.");
}
return 0;
}
Refer the attached image for output.
Attachments:
Similar questions
Computer Science,
3 months ago
History,
3 months ago
English,
6 months ago
Math,
10 months ago
Geography,
10 months ago