write a c++ program to check whether the age entered is eligible to vote or not
Answers
Answered by
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