# C Operators Learn the Basics of Programming Step by Step – MPS

Contents

## c operators with examples

In this tutorial, we will learn basic C operators step by step. In this C programming class, we’ll cowl all supported C operators, clarify their objectives with examples.

The operators assist in mathematical and statistical computing. Hence, please learn this tutorial with full focus.

In C programming, we might carry out many operations on variables like addition, subtraction, division, increment, decrement, and many others. And C language has many built-in operators to hold out such duties. Please see beneath.

### What are Operators in C?

The operators are particular symbols that instruct the compiler to carry out a particular operation on the given variable(s).
There are primarily six sorts of operators. C Operators are given below:
Arithmetic Operators
Relational Operators
Logical Operators
Bitwise Operators
Assignment Operators
Miscellaneous Operators

Let’s examine them out one by one.

## Types of Operators Explanation

### Arithmetic Operators in C

These operators are used to carry out easy arithmetic operations like addition, subtraction, product, quotient, the rest, and many others.

### Relational Operators in C

Relational operators are used to examine a relationship between two or more variables like ‘greater than,’ ‘less than,’ and many others. If the end result is optimistic, then the situation will succeed.

The following desk reveals some relational operators supported in C.

### Logical Operators in C Programming

Logical operators are used to carry out logical operations.

Here are some logical operators supported in C

### Bitwise Operators in C Programming

Bitwise operators are used to carry out operations on binary values.

This desk would enable you.

Now you need to know the binary conversion of a decimal quantity. If not, this instance will enable you.

Let us assume two numbers 3 and 4. Now, in binary format, they’re represented as

``` 8421 //Here each ‘1’ beneath these numbers will add that worth to the quantity

A = 0011 //It is for 3 it is 0+0+2+1 i.e. 3.

B = 0100 //It is for 4 it is 0+1+0+0.

-------

A&B = 0000 //AND operation

A|B = 0111 //OR operation

Complement Operations :

~A = ~3 = 1100 ~B = ~4 = 1011 (Just change 1 by 0 and 0 by 1)

Left Shift and Right Shift operations

A<<1 = 0110 A>>1 = 0001

(Just shift every binary factor to the left or proper by 1)```

### Assignment Operators in C

In C programming, variables get values by utilizing the project operators.

Take an instance, say, if you’ll want to assign the value “7” to a variable recognized as the “count,” then you’ll be able to do so with the following assertion.

`var = 7;`

There are two subtypes of project operators in C programming.

• The easy operator ( = )
• The compound operators (+=, -=, *=, /=, %=, &=, ^=)

### Miscellaneous Operators

These are some miscellaneous operators.

You might not see any applications or pattern code in this chapter as a result of we’ve got been utilizing these C operators in many of our different tutorials.

## Related Posts Pramod Kumar Yadav is from Janakpur Dham, Nepal. He was born on December 23, 1994, and has one elder brother and two elder sisters. He completed his education at various schools and colleges in Nepal and completed a degree in Computer Science Engineering from MITS in Andhra Pradesh, India. Pramod has worked as the owner of RC Educational Foundation Pvt Ltd, a teacher, and an Educational Consultant, and is currently working as an Engineer and Digital Marketer.

## Best PYthon Course   Get More trending Courses