Translate

Wednesday, April 29, 2020

Check eligibility

/*Program to check whether a person is eligible to vote or not */

Control Statement - if else Statement

#include<stdio.h>

#include<conio.h>
void main()
{
    int age;
    printf("Enter Your Age? = ");
    scanf("%d",&age);
    if(age>=18)
      {
          printf("You are eligible to vote");
      }
    else
     {
          printf("You are not eligible to vote");
     }
     getch(); 
}
Output:




No comments:

Post a Comment

C program to make a calculator using the switch statement.

/*perform arithmetic calculation on integers in C language*/ #include<stdio.h> #include<conio.h> void main() {     char op;     ...