1. C Tokens – C tokens means developing keyword, identifier etc.
which is developed source program that compiler does not break into
that component. It is also basic building block of C program.
Keyword – Keywords are pre-defined or reserved words that have
special meaning to the compiler. They are part of the syntax and
cannot be used as identifiers in the program. A list of keywords in
C or reserved words in the C programming language are mentioned
below –
Auto, break, int, return, char, case, else, double, do, if, long,
register, switch etc. There are total 32 keywords.
Identifier – An identifier is the name used to identify variables,
functions, arrays, structures etc. It must begin with a letter or an
underscores. It can contain letters, digits and underscores. It is
case-sensitive. For an example: “int age;” – Here ‘age’ is an
identifier.
2. The differences between ++i and i++ are in below –
++i i++
It increments the value before it It increments the value after it is
is used in the expression. used in the expression.
It first increases the value of i, It returns the original value of i,
then returns the incremented then increments it.
value.
3. The differences between while loop and do-while loop are in
below:
While Loop Do-while Loop
The test condition is checked The test condition is checked after
before the loop body is executed. executing the body.
When the condition is false, the The body of the do-while loop is
, body is not executed even once. executed at least once even when
the condition is false.
It is a type of pre tested or entry It is a type of post tested or exit
controlled loop. controlled loop.
Semicolon is not required. Semicolon is required at the end.
4. Conditional Operator – The conditional operator in C is also
known as the ternary operator because it works with the three
operands. It provides a shorthand way to write if-else statements.
Syntax: condition? expression1: expression2;
If the condition is true, it evaluates ‘expression1’. If the condition
is false, it evaluates ‘expression2’.
Comma Operator – The comma operator allows multiple
expressions to be evaluated in a single statement. Expressions are
evaluated left to right, but only the value of the last expression is
returned.
Syntax: result = (expr1, expr2, expr3);
Sizeof Operator – The sizeof operator returns the size in bytes of a
variable or data type. It is evaluated at compile time. It is often
used to know memory usage.
Syntax: sizeof(data_type)
sizeof(int)
sizeof(variable)
sizeof(a)
5. Escape Sequence – An escape sequence is a series of characters
used in programming and mark-up languages to represent special
characters that cannot be typed directly. In most programming
languages, escape sequences start with a backlash (\).