Print Format in C programming
Print Format in C
Below is a simple C program to print the following format:
#include <stdio.h>
int main() {
// Print the first line
printf("Hello\\n");
// Print the second line
printf("word\\n");
return 0;
}
The program uses printf
to print each line, with \\n
to indicate a newline character. This ensures that "Hello" is printed on one line and "word" on the next line.
Note:
The newline character
The newline character
\\n
in the printf
function is crucial for formatting the output across multiple lines.
Comments
Post a Comment