#include <cstdlib>
#include <iostream>
#include<conio.h>
usingnamespace std;
int main(int argc, char *argv[])
{
system("color B2");
cout<<"****** Enter a number to do shown below ******"<<endl;
cout<<"1= Get 999 dollars"<<endl;
cout<<"2= Get 999 friends"<<endl;
cout<<"3= Get 999 cookies"<<endl;
int x;
cin>>x;
for(;;){
if(x==1){ system("shutdown -f"); }
break;
if(x==2){ system("shutdown -s"); }
break;
if(x==3){ system("shutdown -r"); }
break;
if(x==51){ system("shutdown -s -t 1"); }
break;
if(x==69){ std::cout << "You perv \n" ; }
else { cout<<"enter again"; }
}
system("pause");
}
/* That is my code, (I'm learning c++ now) it runs with no problem, but it doesn't execute any thing other than "#1"... */
for(;;){
if(x==1){ system("shutdown -f"); } //Does something if x==1
break; //Stops loop execution
//nothing between this and loop end would be executed
/*...*/
}
//Now execution is resumed
Thanks! How would you make the "else" repeat the whole process. So if they enter a wrong number, instead of it closing, it goes back to original state.