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
English,
6 months ago
Social Sciences,
6 months ago
Geography,
1 year ago
English,
1 year ago
Physics,
1 year ago
Political Science,
1 year ago
English,
1 year ago