C++ Do While Syntax

Elements of a c++ do while loop do { statement(s); } while( condition ); #include <iostream> int main(){ int userCounter = 0,cnt=0; std::cout << "how many times should we loop ?\n"; std::cin >> userCounter; do { std::cout << "Counting to " << userCounter << " now in the loop for " << cnt + 1 << " times\n"; cnt++; }while( cnt < userCounter ); } So Line 13...
Read More
Top