I am not sure who else is enjoying my programming posts, but I am having fun re-exploring them again 🙂

In this post, we will see the different operators in ‘C’ and how to use them in a program.

The four major mathematical operators are addition, subtraction, multiplication and division and they are represented by these symbols:

a. + -> for addition

b. – -> for subtraction

c. / ->for division

d. * -> for multiplication

e. % -> to get the remainder when dividing

As an example,

10%5 will give ‘0’ and

10/5 will give 2

Let us see these mathematical operators in a ‘C’ program. You can try these programs in the online ‘C’ compiler from this page:

Online C Compiler – Programiz

When the above program is compiled and run, you will get the following answer:

In addition to these operators, there are relational operators(<, >, <=, >=, ==, !=), logical operators(&&, ||, !), bitwise operators, assignment operators.

We will explore more of what to do with these operators in the next ‘C’ post.

This post is the next post for BlogchatterHalfMarathon challenge by @blogchatter

(Visited 14 times, 1 visits today)

Related Posts

Leave a Reply