+ 1
What function does 'num++' perform in WHILE LOOP ?
#include <iostream> using namespace std; int main() { int num=1; int number; int total=0; while (num <= 6) { cin >> number; cout << total << endl; total += number; num++; } return 0; }
2 odpowiedzi
0
MATTHEW CHRISTOPHER , incrementing variable num, if the variable is not incremented the loop never stops as the condition num <= 6, will be always true.
0
Thank you..