C++: Create a loop to print out 0 - 100


SUBMITTED BY: Guest

DATE: Oct. 18, 2013, 6:40 p.m.

FORMAT: C++

SIZE: 293 Bytes

HITS: 1251

  1. // Program Purpose: Create a loop in C++ to print out 0 - 100.
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int i;
  6. i = 0;
  7. while (i <= 100)
  8. {
  9. printf("%d", i);
  10. printf("\n");
  11. i = i + 1;
  12. }
  13. getchar();
  14. getchar();
  15. return 0;
  16. }

comments powered by Disqus