End a new line text in c

In C, you can end a line of text using the \n character, which is an escape sequence that represents a newline.

Here are a few ways to do it:

  1. Using the \n character:

    printf("Hello, world!\n");

    This will print "Hello, world!" followed by a newline character.

  2. Using the puts function:

    puts("Hello, world!");

    The puts function automatically appends a newline character to the end of the string.

  3. Using the fprintf function:

    fprintf(stdout, "Hello, world!\n");

    This will print "Hello, world!" followed by a newline character to the standard output stream.

Note that in all cases, the \n character is a single character, not a string.