Menu
×
Tutorials Ms Word Tutorial Ms Excel Tutorial Ms PowerPoint Tutorial C Language Tutorial C++ Tutorial C Sharp Tutorial Visual Basic Tutorial HTML Tutorial CSS Tutorial JavaScript Tutorial WordPress Tutorial
     ❯   

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 Programming

The individual tokens are −

printf
(
   "Hello, World! \n"
)
;
C Programming

Semicolons

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 Programming

Comments

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 Programming

Comments can’t be inside of other comments, and they can’t be in a string or a character literal.

Spread the love
Scroll to Top
Scroll to Top