Table of Contents
In this tutorial, we will discuss the Operators in C programming language. C programming language consists of various operators to perform many operations.
Arithmetic Operators
An arithmetic operator in C language is used to performs mathematical calculations such as adition, subtraction multiplication division, etc…
Program 1
When the above code is executed , it produces the following result
a+b value is 35
a-b value is 5
a*b value is 300
a/b value is 1
mod value of a,b is 5
Program 2
Program 1
When the above code is executed , it produces the following result
a++ value is10
a– value is 11
++b value is 5
–b value is 5
Program 2
When the above code is executed , it produces the following result
value of c is 21
value of d is 1
value of e of 14
value of f is 0
Assignment operator in C
In the C Programming Language, the assignment operator can be use to assign values for variable
Two type of assignment operator available in C Programming Language
1. Simple assignment operator – =
2. Compound assignment operator – +=, -=, *=. /=, %=, &=
Eg – x+=10;
Relational operator in C
In the C Programming language, relational operator is used to check the relationship beyween two arethmetic operands. If relationship is positive, return true is (true means 1) or if relationship is negative, it returns as false (false means 0)
When you execute the above code , it produces the folloing result
a is equal to or less than b
a is less than b
a is less than b
a is less than b or equal to b
a is not equal to b
a not equal to b
Logical operator in C
Logical opeartors are commenly used in decision making in C Programming. logical opeartor return true (1) or false (0), depending upon program
Multiply two numbers in Java using scanner| 5 different ways In this article, we will…
5 Different ways to Divide two numbers in Java using scanner In this article, we…
Learn 8 Ways to Subtract Two Numbers Using Methods in Java In this article, we…
10 ways to subtract two numbers in Java In this article, we will discuss the…
Java Code Examples – Multiply Two Numbers in 5 Easy Ways In this article, we…
How to Divide two numbers in Java| 5 different ways In this article, we will…
This website uses cookies.