Ivan
asked

Expert
Abhay Jajodia answered
Hello Ivan, really nice question.
Itâs easy to mix up the idea of a function âreturningâ with what \n does in a print statement. They sound similar, but theyâre completely different things.
When you write:
printf("Hey\nHow are you?");
the \n does not return from the function. It doesnât stop anything, and it doesnât exit the print. All it does is tell the output: start a new line here. So the text comes out like this:
Hey
How are you?
The printing continues normally after the newline.
A real return is something you do with a return statement inside a function, not with \n.
If you want more examples or want to see how multiple \n behave, Iâm happy to show you.
C
This question was asked as part of the Learn C Programming course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
