07/03/2016

C Program For Check You Are Eligible For Voting Or Not

Problem :- Write a C Program For Check You Are Eligible For Voting Or Not .

Logic :- This problem may be different for different-2 Country ,In INDIA Voting age is 18 Years .So simple if age is equal or greater then 18 than then you are eligible for vote and if less than you are not mature according to Indian Government or age is 100 and above then rest no need to vote take a rest .

Try Yourself C Program To Find Character Is Vowel Or Not

Solution :-

#include<stdio.h>
int main ()
{
  //Ghanendra Yadav
    int age,temp=0 ;;
    
    while(1)
    {
   
printf("Enter Your Age Here\n");
    scanf("%d",&age);
    
if( age >= 18 && age<100 )
  {
    printf("Congratulation !!! You Are Eligible For Voting\n\n" );
    }
    else if( age >= 100 )
  {
    printf("You Are Eligible But We Suggest Take a Rest\n\n" );
    }
    else if(age<18)
    {
temp = 18 - age; 
    printf("You Not Are Eligible or You are Not Mature \n\n" );
    printf("Wait %d Years For Vote .\n",temp );
    }
  }
   return 0;
}

Output:-

C Program For Check You Are Eligible For Voting Or Not

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: