+ 3
The code provided by the app itself is NOT WORKING
#include <iostream> using namespace std; int main() { int num = 1; int number; int total = 0; while (num <= 5) { cin >> number; total += number; num++; } cout << total << endl; return 0; } it's supposed to ask the user to enter a number 5 times and then shows their sum. But what happens when I run the code that it asks to enter the input only once then multiply it with the "while" condition so what's wrong
2 Réponses
0
you have to run it out of SoloLearn app .. maybe C++Dev or Code:Blocks on Computer.