-
Notifications
You must be signed in to change notification settings - Fork 0
/
C-Comments-NewLines.c
46 lines (31 loc) · 1.07 KB
/
C-Comments-NewLines.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Below code is the syntax of C
#include<stdio.h>
int main(){
// This is a single line comment.
/* This is
a multi-line
comment in C*/
printf("Hello World");
printf("I am learning C!");
/*
printf()
output will be in 1 line, because by default printf don't insert a new line
at the end.
*/
/*
New Line Character:
'\n' is the new line escape sequence that forces the cursor the go to the new
line in the output screen.
Horizontal Tab:
'\t' is the horizontal tab escape sequence that creates a horizontal tab.
Backslash Character:
'\\' is the backslash escape sequence thats inserts a backslash character.
Double Quote Character:
'\"' inserts a double quotation character in the output screen.
*/
printf("\nThe next line will be printed below due to new line(\\n) character");
printf("\nThis is the next line\t");
printf("This is the line after horizontal tab(\\t)\n");
printf("\"This\" is enclosed in double quotes(\")\n");
return 0;
}