0
can someone explain why my code is false in this c++ question pls?
question: You need to make a countdown app. Given a number N as input, output numbers from N to 1 on separate lines. Also, when the current countdown number is a multiple of 5, the app should output "Beep" my code: #include <iostream> using namespace std; int main() { int n; cin >> n; while (n>0) { cout << n<< endl; if (n%5 == 0 ) { cout << "Beep \n"; } n--; } return 0; }
2 ответов
+ 4
Don't print a space after the "Beep", it messes up the comparison between your output and the solution. That's all.
+ 1
thx a lot!!!!