0
Cpp quiz says answers wrong when it’s not.
So I’m doing the cpp course and I’m at the end of module 2 doing the end task called “Countdown” Here’s my code and it is correct but after the one it gives at the end there’s a space below the 1 and in the expected results there’s no extra line after it counts down to 1. So how can I fix it so it doesn’t give a new line after the countdown gets to 1?? My code is basically the exact same as this code but I tried even copying and pasting this code an nothin https://code.sololearn.com/c11usit1dAK0/?ref=app
6 odpowiedzi
+ 3
Pokemon PTA
Maybe you are missing something. Can you copy code from there and share here so we can check where is problem.
+ 1
I just tested your code in the code coach expected and it run fine (all tests passed) ^^
+ 1
you fail the test because you have 'beep' lowercased, while it is expected to be capitalized ('Beep')
+ 1
Pokemon PTA
There is nothing wrong in your code just change "beep" to "Beep"
0
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
//your code goes here
while(n>0){
cout<<n<<endl;
if(n%5==0)
cout<<"beep"<<endl;
n--;
}
return 0;
}
0
This is the code but when its technically corr evt but in the CPP course at the end of module two (22. Countdown) the code problem you write says its wrong. And the only differece i see between mine and the results is after the number 1 thers a extra space on the next line.
4
3
2
1
(Extra blank space in my code here)
But in the expected results there is no soace after one as above..