This is my code. I have gone through it multiple times, making many changes still same error.
#include <iostream>
using namespace std;
void checkAge(int age){
if(age >= 18){
cout<< "As your age is above 18, you are eligible to vote. \n";
}
else{
cout<< "As your age is below 18, you aren't eligible to vote. \n";
}
}
int main()
{
int age;
cout << "Enter your age. \n";
cin >> age;
cout << checkAge(age);
return 0;
}
Aucun commentaire:
Enregistrer un commentaire