In C Programming Operators are the symbols which are used to perform mathematical, and logical operations. You can use the C Operator on individual values or a variables. Below table will show you the list of available C Programming operators with example.

C Programming Operators |
Description |
---|---|

Arithmetic Operators | The Arithmetic operators are used to perform basic mathematical calculations like Addition, Subtraction, Multiplication, Division and Modulus. For more information, Please refer Arithmetic operators in C article. |

Relational Operators | The Relational operators are mostly used either in Loops or If Statements. These are commonly used to check the relationship between two variables. If the relationship is true, operator will return 1 otherwise, it will return value 0. For more information, Please refer Relational Operators in C article |

Logical Operators | The Logical Operators are used to combine two or more conditions, and perform the logical operations using Logical AND (&&), OR (||), and NOT (!). |

Assignment Operators | The Assignment operators are used to assign the values to the declared variables. = (Equals) is the most commonly used assignment operator. For more information, Please refer Assignment Operators article |

Increment & Decrement Operators | Increment and Decrement Operators are used to increase or decrease value by 1. ++ is used to increase the existing variable value by 1, and decrement operator – – is used to subtract or decrease the existing value by 1. For more information, Please refer Increment & Decrement Operators article |

Bitwise Operators | Bitwise operators are used to perform bit operations. First, the decimal values will be converted into sequence of bits ( binary values) i.e 0001, 1011 etc, and bitwise operator will work on these bits like shifting them right to left etc. For more information, Please refer Bitwise Operators in C article |

Conditional Operator | The Conditional Operator is also known as Ternary operator. We use the Conditional Operators in decision making process. Depending upon the expression result this operator returns the statement. Please visit Conditional Operator in C to know the functionality. |

Sizeof Operator | Sizeof operator is mostly used in find the structure size, and array size. For more information, Please refer C Sizeof Operator article |

**C Programming Operators – Arithmetic Example**

In this example, We are going to use two variables to perform various arithmetic operations present in C Language

**C PROGRAM CODE**

// Example for C Programming Operators #include<stdio.h> int main() { int a = 24, b = 4; int addition, subtraction, multiplication, division, modulus; addition = a + b; subtraction = a - b; multiplication = a * b; division = a / b; modulus = a % b; printf("Adding of two numbers a, b is : %d\n", addition); printf("Subtracting of two numbers a, b is : %d\n", subtraction); printf("Multiplying two numbers a, b is : %d\n", multiplication); printf("Division of two numbers a, b is : %d\n", division); printf("Modulus of two numbers a, b is : %d\n", modulus); }

**OUTPUT**

## C Programming Operators – Relational Example

In this example, We are going to use two variables a and b to perform various relational operations present in C programming

**C PROGRAM CODE**

#include <stdio.h> main() { int a = 35; int b = 16; printf("%d > %d: %d \n", a, b, a > b); printf("%d >= %d: %d \n", a, b, a >= b); printf("%d <= %d: %d \n", a, b, a <= b); printf("%d < %d: %d \n", a, b, a < b); printf("%d == %d: %d \n", a, b, a == b); printf("%d != %d: %d \n", a, b, a != b); }

**OUTPUT**

## C Programming Operators – Assignment Example

For this example, We are going to use the two variables x and Total to show you the working functionality of all the Assignment Operators in C Programming Language

**C PROGRAM CODE**

#include <stdio.h> int main() { int x = 5; int Total = 25; printf(" Value of the Total = %d \n", Total += x ); printf(" Value of the Total = %d \n", Total -= x ); printf(" Value of the Total = %d \n", Total *= x ); printf(" Value of the Total = %d \n", Total /= x ); printf(" Value of the Total = %d \n", Total %= x ); return 0; }

**OUTPUT**

Thank you for Visiting our Blog.

## Leave a Reply