- 2
can someone help me with the countdown challenge? am stuck, please!
I want the word "beef" to appear AFTER every multiple of 5. but my code shows it BEFORE. Here is the code (cpp) #include <iostream> using namespace std; int main() { int n; cin >> n; for (; n>0; ) { cout<<n<<endl; n--; if (n%5==0) cout<<"beef"<<endl; } return 0; }
2 Respuestas
+ 2
Alameen
There is Beep not beef
First print number
Then print Beep if number is multiple of 5
Then do decrement in n.
0
Please always tag the language you're asking about.
https://code.sololearn.com/W3uiji9X28C1/?ref=app