fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n=0;
  6. cout<<"Enter: ";
  7. cin>>n;
  8.  
  9. while(n<=2)
  10. {
  11.  
  12. cout<<"Enter again: ";
  13. cin>>n;
  14. n++;
  15. }
  16. }
Success #stdin #stdout 0s 15240KB
stdin
0 0 0 0 4
stdout
Enter: Enter again: Enter again: Enter again: Enter again: