While loop in c++

Please explain the while loop properly .

while loop works same as the for loop
The only difference is that in while loop, we initialize before loop, check condition in while and increment after it inside the loop
eg.

int i=o, n=10;
while(i<n){
cout<<“Hello”;
i++;
}

The above code will print Hello 10 times.