3/07/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

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment