C++ item 21 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ item 21

Whats wrong with my code?

22nd Feb 2022, 8:11 PM
Antonio Torres
Antonio Torres - avatar
7 Answers
+ 5
B should be uppercase in Beep
23rd Feb 2022, 2:08 AM
Simba
Simba - avatar
+ 4
Cool it works now thanks Simba the solution was b -> B in "Beep" 👍
23rd Feb 2022, 3:03 AM
Antonio Torres
Antonio Torres - avatar
+ 2
Idk
22nd Feb 2022, 8:17 PM
Martin Turcotte Couture
+ 2
Tag the programming language you're using, you didn't tag anything(how's that possible?)
23rd Feb 2022, 2:30 AM
Rishi
Rishi - avatar
+ 2
Manav Roy he was referring about countdown project of c++ course. Conditional and loops module code project.
23rd Feb 2022, 5:27 AM
Simba
Simba - avatar
+ 1
Thanks but the app does not validate me
22nd Feb 2022, 8:23 PM
Antonio Torres
Antonio Torres - avatar
0
/*Necesitas hacer una app de cuenta atrás. Dado un número N como entrada, genera números de N a 1 en líneas separadas. Además, cuando el número actual de la cuenta atrás es un múltiplo de 5, la app debería producir "Beep". Ejemplo de entrada: 12 Ejemplo de salida: 12 11 10 Beep 9 8 7 6 5 Beep 4 3 2 1*/ #include <iostream> using namespace std; int main() { int n; cin >> n; int i; //tu código va aquí for (i=n;i>0;i--) if (i%5==0)cout<<i<<endl<<"beep"<<endl; else cout << i << endl; return 0; }
22nd Feb 2022, 8:26 PM
Antonio Torres
Antonio Torres - avatar