100% found this document useful (2 votes)
398 views3 pages

Different Types of Operators in C

Operators are symbols that are used to perform operations on data and variables in C language. The document lists and briefly describes the main types of operators in C, including arithmetic, logical, relational, assignment, conditional, increment/decrement, and bitwise operators. Arithmetic operators are used to perform math operations and can be binary or unary. Logical operators are used to check multiple conditions, while relational operators compare two values. Assignment operators assign values to variables, and compound assignment operators perform an operation and assignment in one step. Conditional operators select an expression based on a condition being true or false. Increment and decrement operators increase or decrease a variable by 1. Bitwise operators are used to test or shift bits.

Uploaded by

veerakumars
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
398 views3 pages

Different Types of Operators in C

Operators are symbols that are used to perform operations on data and variables in C language. The document lists and briefly describes the main types of operators in C, including arithmetic, logical, relational, assignment, conditional, increment/decrement, and bitwise operators. Arithmetic operators are used to perform math operations and can be binary or unary. Logical operators are used to check multiple conditions, while relational operators compare two values. Assignment operators assign values to variables, and compound assignment operators perform an operation and assignment in one step. Conditional operators select an expression based on a condition being true or false. Increment and decrement operators increase or decrease a variable by 1. Bitwise operators are used to test or shift bits.

Uploaded by

veerakumars
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Different types of Operators in C

The symbols that give instructions to perform different types of mathematical and logical
operations are called operators. We can define operators as the tools which can alter the values
of data and variables. The important operators used in C language are:

 Arithmetic operators
 Logical operators
 Relational operators
 Assignment operators
 Conditional operators
 Increment or decrement operators
 Bit wise operators
 Special operators

Arithmetic operators
Arithmetic operators are commonly used operator in programming languages. C programming
language consists of Binary arithmetic and Unary arithmetic. The data, which is operated by
the operator, is called operand. In Unary operation there will be only one operand (eg: -1
Negative number). To perform a binary arithmetic, we need at least 2 operands. Different
arithmetic operators are given below:

Logical operators
Logical operators are also called Boolean operators. These operators are used to check two or
more conditions. Boolean operators are followed:
Relational operators
Operators used to compare two values according to their relation are called Relational
operators. These are also called Comparison operators. For performing relational operation we
must need two operands, then only we can illustrate and check the relation between them. 6
relational operators are:

Assignment operators
Assignment operators are used to assign a value to a variable. ‘=’ is used as assignment operator.
For example i=10;

Compound Assignment operators


These operators are used to assign a value to variable after getting a desired result.
For example x+=z;That is x=x+z;
Both of the above expressions have same meaning but first expression uses short hand
Compound assignment operator and second expression uses simple assignment operator. The
different compound operators are:

Conditional operators
These operators work according to some condition. The syntax is given by
i=expression1? Expression2:expression3
Eg: i=a>b?a:b;
The meaning of above statement is if a>b, then i=a, else i=b

Increment or Decrement operators


The powerful operators in C are increment and decrement operator. ‘++’ is used as increment
operator and ‘–’ used as decrement operator.
Eg: i++; meaning i=i+1;
i–; meaning i=i-1;

Bit wise operators


Bitwise operators are used to test the bit or to shift the bits to either left or right. Operators and
its use are given below:

You might also like