+ 4
Please why is it compiling to 6 and not 5
7 ответов
+ 9
in your While loop 'num' is getting incremented
and the terminating condition is num <6 ..
https://code.sololearn.com/cSeBDmmElBRo/?ref=app
for printing till 5 refer this..
+ 8
Because your initial condition is
int num = 1
change to num = 0
int main()
{
int num = 0;
while (num++ < 6) {
cout << "Number: " << num << endl;
}
+ 3
thanks everyone. for your help. I appreciate
+ 1
alright thanks alot
0
Sir Ace, Please could you drop your email here. I would like to ask you something personally and I need your help . I am sorry for the inconvenience and the fact that sololearn doesn't have a chat platform . I would delete it once I have copied it. thanks Sir. If you don't disclose it also let me know pls.