+ 2
What is different between "while" and "do while" conditions?
"while" first check the condition then do operation, while "do while" initially do operation just after that check the condition. So "do while" do action at least one time
2 odpowiedzi
+ 1
- "do while" will first off all execute the statement in brackets, then check the condition in the "while"
- "while will execute the statement only if the condition is verified!
So u can have this exple:
x=1;
do {
print("This the statement";
x++;
}while(x>2)
Even if the condition below is not true, the loop will output "This the statement" one time.
but with "while', they will no be any output
+ 2
in priorities