This commit is contained in:
2021-04-26 10:52:51 +05:30
parent 0f7742f0be
commit dc7cdddc8c
3 changed files with 17 additions and 1 deletions

15
AgeCheck.c Normal file
View File

@@ -0,0 +1,15 @@
// WAP to check your age > 18 or not (using if else statement).
void main() {
int vote_age;
printf("Input the age of the candidate : ");
scanf("%d",&vote_age);
if (vote_age<18) {
printf("Sorry, You are not eligible to cast your vote.\n");
printf("You would be able to cast your vote after %d year.\n",18-vote_age);
}
else {
printf("Congratulations! You are eligible for casting your vote.\n");
}
}