0% found this document useful (0 votes)
4 views19 pages

Operators-C Programming

The document provides an overview of various types of operators in C programming, including arithmetic, relational, logical, and assignment operators. It includes example code snippets demonstrating the usage and output of these operators. The presentation is led by Prof. Sarala Mary and concludes with a thank you note.

Uploaded by

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

Operators-C Programming

The document provides an overview of various types of operators in C programming, including arithmetic, relational, logical, and assignment operators. It includes example code snippets demonstrating the usage and output of these operators. The presentation is led by Prof. Sarala Mary and concludes with a thank you note.

Uploaded by

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

Operators Prof.

Sarala Mary
Agenda Arithmetic Operators
Relational Operators
Logical Operators
Bitwise Operators
Assignment Operators
05/06/2025 O P E R AT O R S 2
Operators

Arithmetic Operators
05/06/2025
O P E R AT O R S 4
Arithmetic Operators
Code Output
1. #include <stdio.h> 1. a%b=0
2. int main() {
2. +a = 25
3. int a = 25, b = 5;
3. -a = -25
4. // using operators and printing results
5. printf("a % b = %d\n", a % b);
4. a++ = 25
6. printf("+a = %d\n", +a); 5. a-- = 26
7. printf("-a = %d\n", -a);
8. printf("a++ = %d\n", a++);
9. printf("a-- = %d\n", a--);
10. return 0;
11. }
05/06/2025 O P E R AT O R S 5
Operators

Relational Operators
2/2/20XX O P E R AT O R S 7
Relational Operators
Code Output
1. int main() { 1. a<b :0
2. int a = 25, b = 5;
2. a>b :1
3. // using operators and printing results
3. a <= b: 0
4. printf("a < b : %d\n", a < b);
5. printf("a > b : %d\n", a > b);
4. a >= b: 1
6. printf("a <= b: %d\n", a <= b); 5. a == b: 0
7. printf("a >= b: %d\n", a >= b); 6. a != b : 1
8. printf("a == b: %d\n", a == b);
9. printf("a != b : %d\n", a != b);
10. return 0;
11. }
2/2/20XX O P E R AT O R S 8
Operators

Logical Operators
05/06/2025 O P E R AT O R S 10
a && b : 1 a || b : 1 !a: 0
a && b : 1 a || b : 1 !a: 0

Relational Operators
Code Output
1. #include <stdio.h> 1. a && b : 1
2. int main() {
2. a || b : 1
3. int a = 25, b = 5;
3. !a: 0
4. // using operators and printing results
5. printf("a && b : %d\n", a && b);
6. printf("a || b : %d\n", a || b);
7. printf("!a: %d\n", !a);
8. return 0;
9. }

05/06/2025 O P E R AT O R S 11
05/06/2025 O P E R AT O R S 12
Operators

Assignment Operators
05/06/2025 O P E R AT O R S 14
05/06/2025 O P E R AT O R S 15
a && b : 1 a || b : 1 !a: 0
a && b : 1 a || b : 1 !a: 0

Relational Operators
Code Output
1. int main() { 1. a = b: 5
2. int a = 25, b = 5;
2. a += b: 10
3. // using operators and printing results
3. a -= b: 5
4. printf("a = b: %d\n", a = b);
4. a *= b: 25
5. printf("a += b: %d\n", a += b);

6. printf("a -= b: %d\n", a -= b); 5. a /= b: 5

7. printf("a *= b: %d\n", a *= b); 6. a %= b: 0


8. printf("a /= b: %d\n", a /= b); 7. a &= b: 0
9. printf("a %%= b: %d\n", a %= b);
8. a |= b: 5
10. printf("a &= b: %d\n", a &= b);
9. a ^= b: 0
11. printf("a |= b: %d\n", a |= b);
10. a >>= b: 0
12. printf("a ^= b: %d\n", a ^= b);

13. printf("a >>= b: %d\n", a >>= b); 11. a <<= b: 0


14. printf("a <<= b: %d\n", a <<= b);

15. return 0;
05/06/2025 O P E R AT O R S 16
16. }
The way to get started is to quit
talking and begin doing.
Walt Disney

2/2/20XX O P E R AT O R S 17
Summary

A C operator 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.

05/06/2025 O P E R AT O R S 18
Thank you
Presenter Name – Prof. Sarala Mary
Email – [email protected]

05/06/2025 O P E R AT O R S 19

You might also like