+ 1

I made a code for countdown project in c++ but the test case it's show code is not correct if anybody know please help me.

I try to solving the countdown program in c++ and I make code for it.The test case,1,2,4 are not work correct.i don't know why are they incorrect.if anybody know please reply it.here is my code: #include <iostream> using namespace std; int main() { int n; cin >> n; cout<<n<<endl; while(n>1){ if (n%5==0) cout<<"beep"<<endl; n--; cout<<n<<endl; } }

10th Jan 2022, 2:29 PM
Aswin
Aswin - avatar
3 Antworten
+ 3
Beep
10th Jan 2022, 2:32 PM
Simba
Simba - avatar
+ 1
Thank you Simba for replying.
10th Jan 2022, 2:36 PM
Aswin
Aswin - avatar
0
Is it correct
10th Jan 2022, 2:32 PM
Aswin
Aswin - avatar