C operators
for perform any task The variables, constants can joined by various operators to form an expression. There are operands. Operands is a data item on which an operators acts. There are some operators required two operands and some operators required only one operand. The c language support larger number of operators That are mentioned below with several different categories operators in c programming-
—
Operators are giving below-
(1) Arithmetic operators
(2) Assignment operators
(3) Increment and decrement operators
(4) Relational operators
(5) Logical operators
(6) Conditional operators
(7) comma operators
(8) sizeof operator
(9) Bitwise operators
(10) others operators
Operator precedence in C
The operator precedence tells that which operators will evaluated first and next and so on. The associativity tells operator direction to be evaluated. Its direction may left to right or right to left. The upper rows in the table have higher precedence and it decrease as we move down the table. so the operators with precedence level 1 have highest precedence and level 2 have second highest and with precedence level 15 have lowest precedence.so whenever any expression contains more then one operators, then operators that have higher precedence is evaluated first. Here is example
7+6*9;
In the above example in the expression the multiplication operator evaluated first or before the addition operator because multiplication operator has higher precedence
Difference between Identifiers and keywords-
Identifiers |
Keywords |
Identifiers are the user defined words |
Keywords are the pre-defined words. That have a special meaning |
It can be written in both case lowercase and uppercase |
It must be written in a lowercase letter |
It can contain underscore, number, characters |
It does not contain the underscore character and numbers |
Data type |
Size |
int or signed int |
2 byte |
unsigned int |
2 byte |
short int or signed short int |
1 byte |
unsigned short int |
1 byte |
short int or signed short int |
1 byte |
long int or signed long int |
4 byte |
unsigned long int |
4 byte |
float |
4 byte |
double |
8 byte |
long double |
10 byte |