C - Write program to output new line character

Requirements

Write program to output new line character

Hint

The escape sequence of new line character is \n

Demo

#include <stdio.h>

int main()/*ww w.j  a v  a 2 s. c  o m*/
{
    int ch;

    printf("Press Enter: ");
    getchar();
    ch = 'H';
    putchar(ch);
    putchar('\n');
    ch = 'i';
    putchar(ch);
    putchar('!');
    putchar('\n');
    return(0);
}

Result

Related Exercise