If we write int a=42 and then write a do...while loop,we write cout..... and then a++ why doesn't it change the value of a | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If we write int a=42 and then write a do...while loop,we write cout..... and then a++ why doesn't it change the value of a

when the condition in while is false??

8th Mar 2017, 8:21 PM
Nour Ghazal
Nour Ghazal - avatar
1 Answer
+ 3
Output is based on FIFO(First in First Out) That is, the query you write first, will be executed first, and then it will end followed by execution of the next query. Sive you wrote cout before a++;, it will be executed first.
8th Mar 2017, 8:29 PM
Meharban Singh
Meharban Singh - avatar