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");
}
}

BIN
AgeCheck.exe Normal file

Binary file not shown.

View File

@@ -13,3 +13,4 @@
|11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators |
|12 | SolveExpression2.c | SolveExpression2.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" |
|13 | SolveExpression3.c | SolveExpression3.exe | WAP to solve given expression "ans = a / (a+b) - [ d * e / (f*g)]" |
|14 | AgeCheck.c | AgeCheck.exe | WAP to check your age > 18 or not (using if else statement) |