0

Countdown in c++

I'm getting the same outputs, but it says the code is wrong. this is the code #include <iostream> using namespace std; int main() { int n; cin >> n; //your code goes here while(n > 0) { if(n > 1) cout<< n << "\n"; if( n % 5 == 0) cout<< "Beep \n"; if(n == 1) cout<< n; n--; } return 0; }

31st Jul 2021, 5:44 AM
Husam Jezdan
Husam Jezdan - avatar
2 Answers
+ 5
You need to remove the space between p and back slash cout<< "Beep\n";
31st Jul 2021, 6:27 AM
Simba
Simba - avatar
+ 2
I found it 5 minutes ago after searching in code for hour
31st Jul 2021, 6:31 AM
Husam Jezdan
Husam Jezdan - avatar