do {
// body of loop;
}
while (condition);
do {
// codes;
}
while (testExpression);
while (/*condition*/) {
//implementation
}
while (true) {
cout << "hello" << endl;
}
while(condition)
{
statement(s);
}
// Do while loop
// C++ Program to print numbers from 1 to 5
#include <iostream>
using namespace std;
int main() {
int i = 6;
// while loop from 1 to 5
while (i <= 5) {
cout << i << endl;
i++;
}
return 0;
}
int i = 0;
while (i < 5) {
cout << i << "
";
i++;
}
while (x){ ... }
// Executes a statement repeatedly until the value of the condition expression
//becomes false. The test takes place after each iteration.
do {
//statement
} while(condition);
while (true) { // or 1/true
//do stuff
}
//Executes a statement repeatedly, until the value of condition becomes false.
//The test takes place before each iteration
while(condition) {
statement
}
while
Code Example |
---|
Cpp :: make an x using asterisk c++ |
Cpp :: friend class c++ |
Cpp :: dateformat in flutter |
C :: c colour text |
C :: how to slow voice speed in pyttsx3 |
C :: install kubernetes kubectl on mac |
C :: c distance in the cartesian plane |
C :: how to download file in powershell |
C :: Animated sprite from few images pygame |
C :: sstf program in c |
C :: variably modified ‘_memory’ at file scope |
C :: remove on condtion in vec rust |
C :: simplify fractions C |
C :: random number c |
C :: thread in c |
C :: cannot get / react router dom |
C :: srand time null |
C :: c integer to string |
C :: c style array |
C :: right side of div |
C :: for loop in c |
C :: directory folders structure show windows 10 command prompt |
C :: c check if array is empty |
C :: array size in c |
C :: bitwise and in c |
C :: c program to find the frequency of characters in a string |
C :: stack push |
C :: getchar in c |
C :: macos prevent disk mounting |
C :: declaration in c |