C++ examples for Statement:while
Use int value as while loop counter
#include <iostream> using namespace std; int main()//from ww w.j a va 2 s . c o m { int count; count = 1; // initialize count while (count <= 10) { cout << count << " "; count++; // increment count } return 0; }