thank you but i dont konow where i suppose to place...it
here my code:
#include <iostream.h>
int main()
{
int age=0;
char citizen=(char)y || n;
int citizen = 5;
char citizen = reinterpret_cast<char>(y);
cout<<"Enter your age";
cin>> age&&citizen;
if (age>=18 || age<18)
{
cout<<"Are you filipino citizen?(y/n):"<<endl;
cin>> citizen;
{
if (citizen=="y")
{
cout<<"You are eligible to vote"<<endl;
}
else
{
cout<<"You are not eligible to vote"<<endl;
if else
{
cout<<"Are you filipino citizen?(y/n):"<<endl;
cin>> citizen;
{
if (citizen==y)
{
cout<<"You are eligible to vote"<<endl;
}
else
{
cout<<"You are not eligible to vote"<<endl;
}
}
}
return 0;
}
}
}
but i cant execute my output can ou help me again plss.....
well:-/ let's say, that this program is totally bad...
maybe than repairing it, you should read some more tutorials, because in this style you hardly create a functional program. I'm learning from books, and I thing it's better than internet tutorials (just my personal opinion). And if I can give you advice, don't buy books like "Learn C++ in 24 hours", and so. C++ is very complex and difficult language, so you better buy something 'big':-). Good luck
#include <iostream>
usingnamespace std;
int main ()
{
int age = 0;
char citizen = '\0';
cout << "Enter your age: ";
while (!(cin >> age))
{
cin.clear();
cin.ignore(100, '\n');
cout << "No sir, please enter your age (number): ";
}
if (age >= 18)
{
cout << "Are you filipino citizen?(y/n): ";
cin >> citizen;
if (citizen == 'y' || citizen == 'Y')
cout << "You are eligible to vote\n";
else
cout << "\nYou are not eligible to vote\n";
}
else
cout << "You are not eligible to vote\n";
system ("PAUSE");
return 0;
}