ADVERTISEMENT
Basic Syntax In C
Now that you know how a C program is put together, it will be easy to understand the other basic parts of the C programming language.
A C program is made up of different tokens. A token can be a keyword, an identifier, a constant, a string literal, or a symbol. As an example, the C statement below is made up of five tokens:
printf("Hello, World! \n");C ProgrammingThe individual tokens are −
printf
(
"Hello, World! \n"
)
;C ProgrammingSemicolons
When you run a C program, the semicolon ends a statement. In other words, there needs to be a semicolon “ ; ” at the end of each statement. It means that a logical entity has come to an end.
Here are two different statements:
printf("Hello, World! \n");
return 0;C ProgrammingComments
Comments are like notes in a C program; the compiler doesn’t care about them. These characters begin with /* and end with */, as shown below.
/* my first program in C */C ProgrammingComments can’t be inside of other comments, and they can’t be in a string or a character literal.