Display numbers using while loops

January 30, 2011 at 16:51:30
Specs: Windows Vista
My project is to use a while loop to display rows numbering from 1 to 12. I have used while loops in the past, but not for anything to this extent.

1
2
3
4
5
6
7
8
9
10
11
12


See More: Display numbers using while loops

Report •

#1
January 30, 2011 at 18:34:10
Fulfills the requirements:
#include <iostream>
int main() {
  while(true) {
    std::cout << "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n";
    return 0;
  }
}

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question