When is a do-while the better choice over other types of loops? What are some common scenarios where its better than others?
I understand the function of a do-while,
Normally when you need the user to input some value, the counter variable is based on the input value, you use do-while. //The following code is in C++. It requires the user to input a number and repeats until users input number larger than 0.
do{
cout << "Enter a Positive integer: ";
cin >> num;
}while( num < 0 );