diff --git a/AgeCheck.c b/AgeCheck.c new file mode 100644 index 0000000..10f0c90 --- /dev/null +++ b/AgeCheck.c @@ -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"); + } +} diff --git a/AgeCheck.exe b/AgeCheck.exe new file mode 100644 index 0000000..4e7c053 Binary files /dev/null and b/AgeCheck.exe differ diff --git a/Order Of Programs.md b/Order Of Programs.md index cc2526c..a0c05ea 100644 --- a/Order Of Programs.md +++ b/Order Of Programs.md @@ -12,4 +12,5 @@ |10 | BitwiseOperators.c | BitwiseOperators.exe | WAP to perform bitwise 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" | -|13 | SolveExpression3.c | SolveExpression3.exe | WAP to solve given expression "ans = a / (a+b) - [ d * e / (f*g)]" | \ No newline at end of file +|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) | \ No newline at end of file