Professional Documents
Culture Documents
Basic of C - 1.3
Basic of C - 1.3
Polytechnic
Ramgarh, Binpur-I, Jhargram
Department of Computer Science & Technology
2nd Year-3rd Semester
E-Contents : Programming in C
Unit : Basic of C, Unit No : 1
Developed By:
Subhajyoti Mahata
Lecturer, Computer Science & Technology
Raja Ranjit Kishore Govt. Polytechnic, Ramgarh
Contents
Operators
Operator precedence
Associativity of operators
Arithmetic Operator
Cont’d…
Increment (++) and Decrement (--)
Operators
int a = 2, b = 5;
++a; // a : 3
--b; // b : 4
Cont’d…
Assignment Operator
Cont’d…
Relational Operators
Cont’d…
Logical Operator
int a = 5, b;
b = a>2? a : 0; // b : 5
b = a>6? a : 0; // b : 0
Cont’d…
Comma Operator
int a, c = 5, d;
sizeof Operator
char a;
sizeof(a); // return 1
Prefix Operator
int a = 5, b;
b = ++a; // b : 6
Postfix Operator
int a = 5, b;
b = a++; // b : 5
Operator precedence
Operator precedence determines which
operator is performed first in an expression.
Operators associativity
It is used when two operators of same precedence
appear in an expression.
Associativity can be either Left to Right or Right to Left.
Type conversion and Type casting
A type cast is basically a conversion from
one type to another.
www.geeksforgeeks.org
www.programiz.com/c-programming
www.tutorialspoint.com/cprogramming
Questions or Assignments