AgeCheck
This commit is contained in:
15
AgeCheck.c
Normal file
15
AgeCheck.c
Normal 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
BIN
AgeCheck.exe
Normal file
Binary file not shown.
@@ -12,4 +12,5 @@
|
|||||||
|10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators |
|
|10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise operators |
|
||||||
|11 | LogicalOperator.c | LogicalOperator.exe | WAP for logical operators |
|
|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" |
|
|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)]" |
|
|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) |
|
||||||
Reference in New Issue
Block a user