#include<iostream.h>#include<string.h>#include<stdlib.h>#include<stdio.h>void main(){char fn[50],sn[50],ans;
int age;
top:
system("cls");
cout<<"\n\nEnter your first name: ";
cin>>fn;
cout<<"\nEnter your surname: ";
cin>>sn;
[Only Registered Users Can See LinksClick Here To Register] <<"\nEnter your age: ";
cin>>age;
[Only Registered Users Can See LinksClick Here To Register] <<"\n\n\n";
if(age>=18)[Only Registered Users Can See LinksClick Here To Register] <<fn <<" "<<sn <<" you are qualified to vote.\n";
else[Only Registered Users Can See LinksClick Here To Register] <<fn <<" "<<sn <<" you are not qualified to vote.\n";
here:
cout<<"\n\n\n\n\n\nEnter another data? [Y]-Yes or [N]-No: ";
cin>>ans;
cout<<endl<<endl<<endl;
if(ans == 'n'|| ans == 'N'){
exit;}elseif(ans == 'y' || ans == 'Y'){goto top;}else{
cout<<"Invalid input"<<endl;
goto here;
}}
Primera
Unknown Boy
Join Date: Apr 2010
Location: Secret Place
Posts: 617
Views: 415
The Following 2 Users Say Thank You to Primera For This Useful Post: