Soooo simple, but it doesnt work! new line in "c"

can someone tell me why I cant get a new line using “/n”

the following keeps returning “hello, world/n”.

///
#include <stdio.h>
int main(void)
{
printf("hello, world/n");
}
///

Hello there.

Not my language, but I assume you are looking for \n. Not /n.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

1 Like

Yeah, the newline character in C (and most/all languages?) is \n.