#include <iostream> using namespace std; int main() { int num = 1; int number; int total = 0; while (num <= 5) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 1

#include <iostream> using namespace std; int main() { int num = 1; int number; int total = 0; while (num <= 5)

Tell ne how this program works

25th Oct 2020, 1:43 PM
Sada
2 Respostas
+ 1
Your program is not finished.
25th Oct 2020, 1:48 PM
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ - avatar
0
You should increment num in the while loop so that it loops for limited time and execute whatever you want inside loop num += 1 for example and total += num then you can use cout to display the total variable value .
25th Oct 2020, 1:56 PM
HBhZ_C
HBhZ_C - avatar