Professional Documents
Culture Documents
Operators HINDI in C
Operators HINDI in C
HINDI IN C
C Operators
Variables के अंदर values store करवाकर आप उन variables पर कई प्रकार के operations
perform कर सकते है ।
उदहारण के लऱए दो integer variables के अंदर value store करवाकर आप addition का
operation perform कर सकते है और उन दोनों variables की values के sum को print
करवा सकते है । इसी प्रकार आप और भी अऱग अऱग operations variables के साथ perform
कर सकते है ।
Variables के साथ operations perform करने के लऱए आपको अऱग अऱग operators यूज़
करने पड़ते है । इस chapter में आपको ऐसे ही operators के बारे में बताया जा रहा है ।
Operations में operators के साथ जो variables यज़
ू होते है वो operand कहऱाते है ।
उदाहरण के लऱए नीचे ददए गए statement को दे खिये।
c = a + b;
उपर ददए गए statement में a और b को operator (+) के साथ यूज़ ककया गया है इसलऱए ये दोनों
variables operands कहऱायेंगे।
Operators 2 प्रकार के होते है ।
Unary – इस प्रकार के operators लसर्फ एक ही operand के साथ यूज़ ककये जाते है ।
Binary – इस प्रकार के operators के साथ 2 operands यूज़ ककये जाते है ।
Arithmetic Operators
Arithmetic operators mathematical operations perform करने के लऱए यूज़ ककये जाते
है । जैसे की addition, subtraction, division और multiplication आदद। Arithmetic
operators 5 प्रकार के होते है । ये basic mathematical operators होते है ।
Operators Description
+ (Addition) ये operator दो variables की values को add करता है ।
– (Subtraction) ये operator एक variable की value में से दस ू रे variable की value
subtract करता है ।
* ये operator 2 variables की values को multiply करता है ।
(Multiplication)
/ (Division) ये operator एक variable की value से दस
ू रे variable की value को
divide करता है ।
% (Modulus) ये operator division के बाद शेष बची हुई value को प्राप्त करने के
लऱए यूज़ ककया जाता है ।
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter two numbers ");
scanf("%d%d",&a,&b);
c=a+b;
printf("Addition of a and b is %d\n",c);
c=a-b;
printf("Subtraction of a and b is %d\n",c);
c=a*b;
printf("Multiplication of a and b is %d\n",c);
c=a/b;
printf("Division of a and b is %d\n",c);
c=a%b;
printf("Remainder of a and b is %d\n",c);
return 0;
}
Output
Enter two numbers 5
4
Addition of a and b is 9
Subtraction of a and b is 1
Multiplication of a and b is 20
Division of a and b is 1
Remainder of a and b is 1
Assignment Operators
Assignment operators variables की values को एक दस
ू रे को assign करने के लऱए यूज़ ककये जाते
है । C language में यूज़ होने वाऱे ववलभन्न assignment operators के बारे में नीचे ददया जा रहा है ।
Operators Description
= ये operator right side के operand की value को left side के operand को
assign करता है ।
+= ये operator left side के operand में right side के operand की value को
add करके result left side वाऱे operand को assign करता है । इसे आप
इस प्रकार भी लऱि सकते है । a = a+b;
Source Code :
#include <stdio.h>
int main()
{
int a=20,b=12;
b = a + b;
printf("value of b is %d\n",b);
b += a;
printf("value of b is %d\n",b);
b -= a;
printf("value of b is %d\n",b);
b *= a;
printf("value of b is %d\n",b);
b /= a;
printf("value of b is %d\n",b);
b %= a;
printf("value of b is %d\n",b);
b &= 2;
printf("value of b is %d\n",b);
b |= 2;
printf("value of b is %d\n",b);
b ^= 2;
printf("value of b is %d\n",b);
b <<= 2;
printf("value of b is %d\n",b);
b >>= 2;
printf("value of b is %d\n",b);
return 0;
Output
value of b is 32
value of b is 52
value of b is 32
value of b is 640
value of b is 32
value of b is 12
value of b is 0
value of b is 2
value of b is 0
value of b is 0
value of b is 0