0% found this document useful (0 votes)
20 views

C Operators

The document discusses different types of operators in the C programming language including arithmetic, relational, shift, logical, bitwise, ternary, assignment, and misc operators. It also covers the precedence of operators in C and provides an example to demonstrate how precedence works.

Uploaded by

z886zn7vjw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

C Operators

The document discusses different types of operators in the C programming language including arithmetic, relational, shift, logical, bitwise, ternary, assignment, and misc operators. It also covers the precedence of operators in C and provides an example to demonstrate how precedence works.

Uploaded by

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

Custom Search

Home C C++ C# Java SQL

C Operators
An operator is simply a symbol that is
used to perform operations. There can be
many types of operations like arithmetic,
logical, bitwise, etc.

There are following types of operators to


perform different types of operations in C
language.

Arithmetic Operators

Relational Operators

Shift Operators

Logical Operators

Bitwise Operators

Ternary or Conditional Operators

Assignment Operator

Misc Operator

Precedence of Operators in C
The precedence of operator species that
which operator will be evaluated first and
next. The associativity specifies the
operator direction to be evaluated; it may
be left to right or right to left.

Let's understand the precedence by the


example given below:

int value=10+20*10;

The value variable will contain 210


because * (multiplicative operator) is
evaluated before + (additive operator).

The precedence and associativity of C


operators is given below:

Category Operator Associativity

Postfix () [] -> . Left to right


++ - -

Unary + - ! ~ ++ Right to left


- - (type)*
& sizeof

Multiplicative */% Left to right

Additive +- Left to right

Shift << >> Left to right

Relational < <= > Left to right


>=

Equality == != Left to right

Bitwise AND & Left to right

Bitwise XOR ^ Left to right

Bitwise OR | Left to right

Logical AND && Left to right

Logical OR || Left to right

Conditional ?: Right to left

Assignment = += -= Right to left


*= /=
%=>>=
<<= &=
^= |=

Comma , Left to right

← prev next →

Help Others, Please Share

Make it in Germany
Working in Germany: the o1cial website for
quali:ed professionals
Make it in Germany Visit Site

Join Javatpoint Test Series


Placement AMCAT Bank GATE
Papers eLitmas PO/Clerk NEET
TCS Java UPSSSC CAT
HCL Python Government
Railway
Infosys C Exams CTET
IBM Programming
SSC IIT JEE
Accenture NetworkingCivil
Services
SBI

Learn Latest Tutorials

Scipy Tutorial

Spring Clo. Scipy

DevOps GitHub

Matlab Tutorial

Matlab Microservices

Latex Tutorial

Inkscape Latex

Magento RESTful

Linq Tutorial

LINQ Laravel

Preparation

Aptitude

Aptitude Reasoning

Verbal Ability

Verbal A. Interview

Company

Trending Technologies

AWS Tutorial

AI
AWS

Cloud tutorial

Selenium Cloud

Hadoop tutorial

Hadoop ReactJS

D. Science Angular 7

Git Tutorial

Blockchain Git

ML

B.Tech / MCA

DBMS tutorial

DS
DBMS

DAA tutorial

OS
DAA

C. Network Compiler D.

COA D. Math.

E. Hacking C. Graphics

html tutorial

Software E.
Web Tech.

Cyber Sec. Automata

C++ tutorial

C C++

Java tutorial

.Net
Java

Python tutorial

Python Programs

Control S. Data Mining

You might also like