0

Countdown in cpp

I've completed this problem compiler shows some error I didn't able to seen bug if you see any error in my program please let me know #include <iostream> using namespace std; int main() { int n; cin >> n; for(;n<=1;n--){ if(n % 5 == 0){ cout<<"Beep"<<endl; } } return 0; }

16th Nov 2021, 9:55 AM
Ramesh
5 Answers
+ 6
Ramesh , we need to have more Information about the task from you. please mention the lesson / exercise number. thanks!
16th Nov 2021, 11:30 AM
Lothar
Lothar - avatar
+ 5
Hello, please include your code in the question. We can't help if we can't see the code. https://www.sololearn.com/Content-Creation-Guidelines/
16th Nov 2021, 10:51 AM
Koketso Dithipe
Koketso Dithipe - avatar
+ 3
Where is your code? You didn't show us anything. Then how can we find errors in your code?
16th Nov 2021, 10:02 AM
Rishi
Rishi - avatar
+ 2
Sorry I forget to mention my code ,this is my code
16th Nov 2021, 11:08 AM
Ramesh
+ 2
Ramesh the condition inside your if block which is inside your for loop, is wrong. It should be >= instead of <=. Refer the below code where I've shown it on practise https://code.sololearn.com/c0ASTxfyOqOJ/?ref=app
17th Nov 2021, 5:25 AM
Rishi
Rishi - avatar