Computer Science, asked by vaishnavibshetty6, 1 year ago

write a c++ program to check whether the age entered is eligible to vote or not

Answers

Answered by sswaraj04
3

Answer:

#include <iostream>

using namespace std;

int main()

{

   int age;

   cout<<"Enter your age";

   cin>>age;

   if(age>=18)

   cout<<"You are eligible to vote";

   else

   cout<<"You are not eligible to vote";

   return 0;

}

Explanation:

Simply check using if condition whether user age is greater than 18 or not and print related message

Hope it helps :-)

Similar questions