Q:

What is a Do and While statement

#include <iostream>
#include <windows.h>
#include <cstdlib>
using namespace std;
bool setstart = true;
int main(){
  int x;
  int y;
  cout << "Welcome to the guessing game\n";
  do {
 cout << "Please enter a number from 0 to 100: ";
 cin >> x;
 } while (x < 0 || x > 100);Sleep(2000);
 system("cls");
 cout<<"ok player 2 pick the guess";
 cin>>y;
 if (x == y){
  cout<<"congrats you got it right";
       }
        else{
        if (x < y){
        cout<<"Go lower";}
        else {
        if (x > y){
        cout<<"higher";}}
        }
 system("pause>nul");
  return 0;
  }

I really just dont understand it. How would i use it? also does a do and while mean that Do is what is happening and while it is happening does it do the While? This is some code my friend did for me can any of you really specificly explain it?

A:

The do {} while; loop executes exactly once before the condition is checked: 
do {
   "//code stuff here"
} while (condition);

is equivalent to
"//code stuff here"
while (condition) {
  "//code stuff here"
}

