num_test.cpp 391 B

12345678910111213141516
  1. // num_test.cpp -- use numeric test in for loop
  2. #include <iostream>
  3. int main()
  4. {
  5. using namespace std;
  6. cout << "Enter the starting countdown value: ";
  7. int limit;
  8. cin >> limit;
  9. int i;
  10. for (i = limit; i; i--) // quits when i is 0
  11. cout << "i = " << i << "\n";
  12. cout << "Done now that i = " << i << "\n";
  13. // cin.get();
  14. // cin.get();
  15. return 0;
  16. }