2. Header Files
Header files contain set of predefined standard
library functions that we can include in our C
programs. But, to use these various library function,
we have to include the appropriate header file:
Examples:
#include<stdio.h> is a header file that consists of
standard input/output like printf(), scanf()etc.
5. Keywords
C language has 32 reserved keywords.
Since keywords have specific meaning, we cannot
use them as identifiers.
All keywords are to be written in lower-case.
7. Variables
A variable is an identifier that is used to store a data
value.
It is a symbolic name assigned to the memory
location where data is stored.
Example : int a = 7; 7 3 -98 Garbage value
int b = 3; a b c
int c ;
• A variable can have only single data item at any
given time during the program executio.
8. Constants
Constants are the identifier that represent fixed values.
Integer Constants:
It’s an integer valued number.
It consists a sequence of digits.
9. Floating-point Constants:
These represent numbers containing fractional
parts.
• Character Constants:
It is a single character, enclosed in apostrophes
(single quotation marks). Several character constants
and their ASCII values are shown below.
10. The Digraph and Trigraphs
In computer programming, digraphs and trigraphs are collection of
sequences of two and three characters respectively. Mostly they appear
in source code, which a programming language specification requires
an implementation of that language to treat as if they were one other
character.
11. Data Types
In C, every variable has a data type. Data type
specifies the size and type of the value stored in that
variable.
12. Fundamental Data Type/ Primary Data
Type
These data types are also called as primary or built-in or basic data
types.
The modifiers signed, unsigned, long and short may be applied to
character and integer basic data types. However, the modifier long may
also be applied to double.
13. Operators
Arithmetic Operators:
These are binary operators as they take two operands. And the
operands must be numeric values.
When both operands are integers, the result is integer. i.e. an integer
division result in truncation towards zero.
If one is floating point and other is integer, the result is floating point.
15. Logical Operators
Logical operators are used to check 2 or more different
conditions and take decision according to their values.
Below is the list of possible conditions:
For &&
• In this case, the result is True only if both the conditions
are true.
16. For ||
• In this case, the result is False only if both the
conditions are False.
17. For !
The logical NOT operator takes single operand and
reverses the value of the expresssion.
20. All unary operators are used as prefix except the
increment and decrement.
21. Conditional Operator
This operator is used to check conditions and depending on
the result, the statement is executed else we go for another
execution.
Conditional operators are used in place of if-else statement.
This operator is also called as ternary operator as it
takes 3 operands.
22. Bitwise Operators
This is binary operator as it takes 2 operands.
Both operands must be of same time.
This operator is applied to each pair of bits independent of
other bits within the operand .
24. For ^
The XOR operator sets 1 in each bit position where its operands have
different bits and 0 where they are same.
One’s complement operator(~):
It takes only one operand thus it is an unary operator.
It inverts the bits of its operand i.e. each 1 is converted to 0 and vice versa.
It’s used for encrypting the files.
25. Shift Operators
Shift operators are used to shift the bits either to left
or right.
These operators take two operands. The first
operands is the bit pattern to be shifted and the
second is an unsigned integer, a number that
indicates the number of places the bits are shifted.
1. Left shift operator(<<):This operator shifts the
bits to the left.
2. Right shift operator(>>):This operator shifts
the bits to the right.
26. Size of Operator
The size of operator is a special operator used to
return the size of its operand in bytes.
Example:
int i , j;
j = sizeof(i);
// It will give j=2. Since integer occupies 2 bytes and I
is an integer.