Thursday, March 11, 2021

C PROGRAM to enter age and display whether a person can vote or not.

 

1.     WRITE A C PROGRAM  to enter age and display whether a person can vote or not.

 

#include<stdio.h>

#include<conio.h>

int main()

{

int a;

printf("Enter your age: ");

scanf("%d", &a);

if(a>=18)

printf("You can vote");

else

printf("You cannot vote");

return 0;

}

 

No comments:

Post a Comment