#include <iostream> int main() { int counter; std::cout << "How many hellos? "; std::cin >> counter; do { std::cout << "Hello\n"; counter--; } while (counter >0 ); std::cout << "counter is: " << counter << std::endl; return 0; }
How many hellos? 5 Hello Hello Hello Hello Hello counter is: 0