c++ do loop code example
Example 1: how to make a Loop in c++
for (int i; i < 10; i++)
{
cout << i << "\n";
}
Example 2: c++ do while loop
do {
// codes;
}
while (testExpression);
Example 3: how to make for loop in c++
for (int i = 0; i < 10; i++){
//Do something as long as i is less than 10,
//In that case it will loop 10 times
//use break; to restart the loop whenever you want to cancel the loops.
cout << i;
//at the end, remember i will be increased by 1.
}
//output 0123456789