0

Hey can you tell me what's wrong in this code?

#include <iostream> using namespace std; int main() { int n; cin >> n; //tu cĂłdigo va aquĂ­ while(n>=1){ if(n%5==0){ cout<<n<<endl; cout <<"beep"<<endl;} else{ cout<<n<<endl; } n-=1; } return 0; }

10th Jan 2023, 4:11 PM
Thalia Zayas Suarez
2 Answers
0
I vaguely remember that the word was "Beep" - with uppercase 'B' as first letter. Could it be?
10th Jan 2023, 5:03 PM
Ipang
0
The code is missing a closing brace '}' at the end of the while loop. #include <iostream> using namespace std; int main() { int n; cin >> n; //tu cĂłdigo va aquĂ­ while(n>=1){ if(n%5==0){ cout<<n<<endl; cout <<"beep"<<endl;} else{ cout<<n<<endl; } n-=1; } } return 0; }
10th Jan 2023, 9:55 PM
Aditya Dixit