0

What is the output?

int num = 1; while (num<6){ num=num+1 } count << num; //Output 6 Can anyone explain this how it's come??

21st Oct 2019, 3:50 AM
Malem Yengkhom
Malem Yengkhom - avatar
2 Antworten
+ 4
Malem Yengkhom when the loop runs for num=5 , condition of while is satisfied and then inside while loop num is again incremented by 1. ->Now value of num is 6 ->now the condition of while is false so loop breaks ->now when you display the value of num then it would be 6
21st Oct 2019, 4:09 AM
Arsenic
Arsenic - avatar
0
Thanks buddy for information ❣️
21st Oct 2019, 4:37 AM
Malem Yengkhom
Malem Yengkhom - avatar