What am I doing wrong? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

What am I doing wrong?

It keeps saying "n" not declared in this scope. #include <iostream> using namespace std; int main() { //modify the given statement cout << "C++"; printf("C") /n printf("+") /n printf("+") /n return 0; }

11th Oct 2021, 12:45 AM
Jeremy
Jeremy - avatar
4 Respuestas
+ 2
You probably meant: \n And just include it in the string to print so... printf("C\n"); // Don't forget the semicolon!
11th Oct 2021, 12:52 AM
Slick
Slick - avatar
+ 1
Put \n not /n inside printf inside the string
11th Oct 2021, 12:53 AM
Stefanoo
Stefanoo - avatar
+ 1
That's an invalid syntax it's \n & it should be written inside the printf function within the string. printf("C\n"); & end this with the semicolon.
11th Oct 2021, 12:55 AM
zexu knub
zexu knub - avatar
0
Jeremy #include <iostream> using namespace std; int main() { //modify the given statement cout << "C\n+\n+"; }
11th Oct 2021, 4:32 AM
BroFar
BroFar - avatar