+ 2
Explain
Hey guys, I don't understand this code, what that means literally: while (num <= 5) { cin >> number; total += number; num++; help please
2 Respuestas
+ 2
until "num" is minor or equal to 5, it ask you a "number", add it to "total", and increment "num".
+ 2
its saying that while num is less than or equal to 5, it will keep repeating. so if num starts at 0, then the num++ will keep ading 1 to num. num++ means num + 1... so the loop keeps changing num until it gets to 5 then it will stop when 5 turns to 6 because then num <= 5 will be false and stop the loop....