top of page
do while rotation statement 

do: Runs the code and then checks the condition
While: It is a statement that acts like an if statement, but it does repeat
{command}do. do
{What happens in the event of repetitiont}(condition)while

#include<iostream>//We start by placing the libraries
using namespace std;//We start by placing the libraries
int main(){//main function
int repeat=0;//The computer starts counting from zero, not one
//We declared a variable with a value of zero so that we could repeat the statement 8 times
do. do
{cout<<"hello friend"<<endl;//Run the code and check
condition and then print
repeat++
;}// Increment the iteration counter until the condition expires
while(repeat<8);//do check the condition before activating the statement 
return 0;
}

image.png
bottom of page