Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

Operators in C programming Language

Posted on September 22, 2017January 24, 2020

Table of Contents

  • Operators in C programming language
    • Increment or dicrement operator
  • Related

Operators in C programming language

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

When the above code is executed , it produces the following result
Enter value to a..
12
Enter value to b..
10
a+b value is 22
a-b value is 2
a*b value is 120
a/b value is 1
mod value of a,b is 2

Increment or dicrement operator

In C Programming language, available increment(++) or dicrement operator( — ) is used to change the value of numerical operand

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;


 

When you execute above code , it produces the folloing result
value of y, in y=x: 10
value of y, in y+=x: 20
value of y, in y-=x: 10
value of y, in y*=x: 100
value of y, in y/=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




When you execute the above code , it produces the following result
you are elder or boy
you are not a teenagers
Betwise Operator in C
Operator in Java
Operator in C++
Operator in Python

 

Related

Recent Posts

  • Multiply two numbers in Java using scanner| 5 different ways
  • 5 different ways to Divide two numbers in Java using scanner
  • Learn 8 Ways to Subtract Two Numbers Using Methods in Java
  • 10 ways to subtract two numbers in Java
  • Java Code Examples – Multiply Two Numbers in 5 Easy Ways
  • How to Divide two numbers in Java| 5 different ways

tag

Addition (8) Array (38) C++ language (91) C language (98) c sharp (23) Division (8) Function (29) if else (32) Java language (108) JavaScript (5) loops (138) Multiply (8) Oop (2) patterns (66) PHP (13) Python Language (38) Subtraction (9) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2026 Code for Java c | Powered by SuperbThemes