0
C++ SOLOLEARN COMPILER
I was trying to complete a module project in c++. The problem to solve was "to output the word beep if the number is a multiple of 5". Ok my code is as follows: int n; cin >> n; //your code goes here for (int i =n ; i > 0; i--) { cout <<n<<endl; if( i % 5 ==0 ){ cout<<"beep"<<endl; } } I am certain that the above code is correct however when I run it. It says it's wrong. I run the same come in a IDE and it works. So I think the sololearns compiler is the problem. IF SOMEONE DID THIS SAME PROBLEM LET ME KNOW HOW YOU DID IT
3 Answers
+ 3
According to the question you have to display word "Beep" ( note the capital *B*) in the output not "beep".
+ 2
You are outputting additional 'n' number, when you have to output "Beep" only according to the question
+ 1
Never mind. I ascertained the error. đ€Łit was a simple mistake.