C++ examples for Statement:while
Use a while loop to display all multiples of 13 lower than 500.
#include <iostream> int main() /*from w w w . ja v a 2 s.c om*/ { int counter = 0; while (counter < 500) { counter++; if (counter % 13 == 0) { std::cout << counter << " "; } } std::cout << "\n"; return 0; }