Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Basics of programming language

Rating
-
Sold
-
Pages
22
Uploaded on
29-04-2026
Written in
2025/2026

Lecture notes of 22 pages for the course IIT JEE , Upsc at IIT JEE , Upsc (Basic need to learn)

Institution
Course

Content preview

Unit 2
Operators and Expressions
What is a C Operator?

An operator in C can be defined as the symbol that helps us to perform some
specific mathematical, relational, bitwise, conditional, or logical computations
on values and variables. The values and variables used with operators are
called operands. So we can say that the operators are the symbols that perform
operations on operands.




For example,
c = a + b;


Here, ‘+’ is the operator known as the addition operator, and ‘a’ and ‘b’ are
operands. The addition operator tells the compiler to add both of the operands
‘a’ and ‘b’.

Types of Operators in C

C language provides a wide range of operators that can be classified into 6
types based on their functionality:
1. Arithmetic Operators
1. Relational Operators
1. Logical Operators
1. Bitwise Operators
1. Assignment Operators
1. Other Operators

,2.1 Arithmetic operators
Arithmetic operators are used to perform common mathematical operations


+ Addition Adds together two values x+y



- Subtraction Subtracts one value from another x-y



* Multiplication Multiplies two values x*y



/ Division Divides one value by another x/y



% Modulus Returns the division remainder x%y



Integer Arithmetic
When both the operands are integer.
a-b=10
a+b=18
Real Arithmetic
When both the operands are real.
x=6.0/7.0
y=1.0/3.0
Mixed Mode Arithmetic
When one operand is real and another is integer.
x=15/10.0
y=15/10

, #include <stdio.h>
int main()
{
int a = 10, b = 4, res;
// printing a and b
printf("a is %d and b is %d\n", a, b);
res = a + b; // addition
printf("a + b is %d\n", res);
res = a - b; // subtraction
printf("a - b is %d\n", res);
res = a * b; // multiplication
printf("a * b is %d\n", res);
res = a / b; // division
printf("a / b is %d\n", res);
res = a % b; // modulus
printf("a %% b is %d\n", res);
return 0;
}
2.2 Relational operators
relational operators are the symbols that are used for comparison between
two values to understand the type of relationship a pair of numbers shares.
The result that we get after the relational operation is a boolean value, that tells
whether the comparison is true or false.
Relational operators are mainly used in conditional statements and loops to
check the conditions in C programming.

Written for

Course

Document information

Uploaded on
April 29, 2026
Number of pages
22
Written in
2025/2026
Type
Class notes
Professor(s)
Satish
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
malgesatish

Get to know the seller

Seller avatar
malgesatish KJEI
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 week
Number of followers
0
Documents
5
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions