What is operator in C?

Operator என்பது ஒரு symbol. இந்த symbol, குறிப்பிட்ட சில mathematical or logical operations-களை எவ்வாறு கையாளவேண்டும் என்பதை compiler-க்கு தெரியபடுத்துகிறது. இந்த symbol program-ல் data-வையும் variables-ஐயும் கையாள்வதற்காக பயன்படுத்தபடுகிறது.

Arithmetic Operators

Mathematical operations என்று சொல்லகூடிய கூட்டல்(addition), கழித்தல் (subtraction), பெருக்கல் (multiplication), வகுத்தல் (division), மட்டு(modulo) போன்றவைகளை கையாள்வதற்காக பயன்படுத்தபடுகிறது.

List of Arithmetic Operatos:

Here consider the value A=20 and B=3

Operator Operation Usage
+ Sum A and B A + B = 23
Difference of A and B A − B = 17
* A multiplied by B A * B = 60
/ Divides A by B. A / B = 6.666667
% Reminder of the division A % B = 2

Simple example for arithmetic operators

#include<stdio.h>
#include<conio.h>
void main(){
    int a=20,b=3;
    printf("sum of a and b is %d \n",a+b);
    printf("difference of a and b is %d \n",a-b);
    printf("product of a and b is %d \n",a*b);
    printf(" a divided by  b is %f \n",(float)a/b);
    printf("a modulus b is %d \n",a%b);
    printf("b modulus a is %d \n",b%a);
}

output:

sum of a and b is 23

difference of a and b is 17

product of a and b is 60

a divided by b is 6.666667

a modulus b is 2

b modulus a is 3

Comments

Pathamuthu 7th December,2024 02:48 pm
Ithe mathiri Java ku podunga
prasanna 20th October,2023 09:15 pm
pls make deep and add more topics and some examples
Petchiyammal 6th November,2022 08:59 pm
Easya puriuthu. Thank you so much.
Karthic 19th November,2021 08:19 pm
Cggg
T.Soundharya 7th October,2021 11:35 am
Innum konjam dipa iruntha paravalai