Operators are used to perform operations on variables and values.
It is used to perform arithmetic operation like Addition,Subtraction,multiplication,division and modulus.
Types of arithmetic operators is given below:-
The word Assignment is stand for 'assign'+'ment' means "assign value to some variable".the value of right side which have same datatype to left side.
Types of assignment operators is given below:-
This operator is used in comparison of the values of two operands.means suppose we have two number x=12 and y=13 we can apply (>,<,<=,>=,==,!=) if we compare x<y,then it return 1,if x>y,then it return 0.
Types of Relational operators is given below:-
When we combine two or more Condition and implement original condition then we are use logical operater
Types of Logical operators is given below:-
In C programming languages there are 6 bitwise operators and
types of Bitwise operators and its function are:-
The bitwise AND operator is denoted by single ampersand: &. While performing the bitwise AND operation is 1 if both the bits have the value as 1; otherwise, the result is always 0.
#include<stdio.h> int main() { int a=7,b=11; printf("%d & %d=%d",a,b,a&b); }
11
The bitwise OR operator is denoted by: |. While performing the bitwise OR operation is 1 if any one of the bits have the value as 1; otherwise, the result is always 0.
#include<stdio.h> int main() { int a=7,b=11; printf("%d | %d=%d",a,b,a|b); }
15
The bitwise NOT operator is denoted by: '~'. While performing the bitwise NOT operation is 1 if bit is 0; otherwise, the result is always 0.
#include<stdio.h> int main() { int a=7; printf("~%d=%d",a,~a); }
~7=248
The bitwise Right Shift operator is denoted by: '>';, and when two numbers, right shifts the bits of the first operand, the second operand decides the number of places to shift.
#include<stdio.h> int main() { int a=7; printf("%d >>1=%d",a,a>>1); }
7>>1=5
The bitwise Left shift operator is denoted by: <, and when two numbers, left shifts the bits of the first operand, the second operand decides the number of places to shift.
#include<stdio.h> int main() { int a=7; printf("%d <<1=%d",a,a<<1); }
7<<1=22