Why should we use endl here?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why should we use endl here??

endl is used to a newline to print second text .... we can see in the last program int x = 11; x++; cout << x; //Outputs 12 here we didn't use endl....but why did we use endl in this program?? int x=11; x++; cout<<x<<endl;

28th Dec 2017, 7:02 PM
Divyashree K.N
Divyashree K.N - avatar
4 Respostas
+ 2
endl just causes the program to print on the next line.in situations 2,anything you cout next will be on another line
28th Dec 2017, 7:12 PM
į Œį ŒBrains[Abidemi]
į Œį ŒBrains[Abidemi] - avatar
+ 2
Actually, it means end line the reason it's to put a space between lines You can use \n
29th Dec 2017, 4:51 AM
Marƭa JosƩ
Marƭa JosƩ - avatar
+ 1
in program2 what should print in next line ??
28th Dec 2017, 7:18 PM
Divyashree K.N
Divyashree K.N - avatar
+ 1
thank you
28th Dec 2017, 7:24 PM
Divyashree K.N
Divyashree K.N - avatar