64 506
Assignments Done
99,1%
Successfully Done
In September 2018

Answer to Question #21474 in C++ for komba tiem

Question #21474
Write a program that asks the user to enter any number other than the number asked equal to the number of times they have been asked to enter a number .(ie on the first iteration "Please enter any number other than 0"and on the second iteration "Please enter any number other than 1"etc.The program must behave accordingly exiting when the user enters the number they were asked not to.)
Expert's answer

# include <iostream>

using namespace std;


int main(){
& int c,iter(0);
for (iter=0; iter<20;iter++){
cout<<"Enter num, other that "<<iter<<" : ";
cin>>c;
if(c==iter){ cout<<"You had to enter number other than "<<iter<<" !!!\n";
iter--;
}
}

system("PAUSE");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions