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

C Operators Demo

C Operators are symbols that perform operations on variables and values, categorized into arithmetic, relational, logical, bitwise, assignment, and miscellaneous operators. Each type of operator has specific symbols and examples demonstrating their usage in C programming. Operators are essential for computations and decision-making in programs.

Uploaded by

amitkumar950925
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

C Operators Demo

C Operators are symbols that perform operations on variables and values, categorized into arithmetic, relational, logical, bitwise, assignment, and miscellaneous operators. Each type of operator has specific symbols and examples demonstrating their usage in C programming. Operators are essential for computations and decision-making in programs.

Uploaded by

amitkumar950925
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Demo Notes: Operators in C

C Operators are symbols that perform operations on variables and values.

Types of Operators:
1. Arithmetic Operators: (+, -, *, /, %)
Example: int a = 10, b = 3;
int sum = a + b; // sum = 13

2. Relational Operators: (==, !=, >, <, >=, <=)


Example: if (a > b) { printf("a is greater"); }

3. Logical Operators: (&&, ||, !)


Example: if (a > 5 && b < 5) { printf("Condition met"); }

4. Bitwise Operators: (&, |, ^, <<, >>)


Example: int x = 5 & 3; // Bitwise AND

5. Assignment Operators: (=, +=, -=, *=, /=, %=)


Example: a += 5; // a = a + 5

6. Miscellaneous Operators: (sizeof, ternary ?:, & (address), * (pointer))


Example: int size = sizeof(int); // size of int in bytes

Operators help in performing computations and making decisions in programs.

You might also like