Variables | Sololearn: Learn to code for FREE!



int a = 10; int b = a; cout<<“a+b”<<endl; // displays 20; why does there have to be an ‘endl’ since its a single statement. Is this alternative wrong?[ cout<<“a+b” ; ]

9/21/2019 9:22:39 PM

Nicholas Amponsah

4 Answers

New Answer


Nicholas Amponsah you just need to put the endl if you want the cursor to jump to the next line after printing the result.


Ulisses Cruz thank you, i do know that. All I wanna know is does this coding necessarily have to be the one above


Hi I wont , JS is fun ,this code


Hello am iranian and my language is parsian