Arithmetic Operators in C Language (C लैंग्वेज में अंकगणितीय ऑपरेटर्स) Introduction to Arithmetic Operators (अंकगणितीय ऑपरेटर्स का परिचय)

Arithmetic operators are used to perform mathematical operations on operands, such as addition, subtraction, multiplication, division, and finding the remainder.

अंकगणितीय ऑपरेटर्स का उपयोग ऑपरेंड्स पर गणितीय क्रियाएँ करने के लिए किया जाता है, जैसे जोड़, घटाव, गुणा, भाग तथा शेषफल ज्ञात करना।

The arithmetic operators listed below are binary operators because they operate on two operands.

नीचे दिए गए अंकगणितीय ऑपरेटर्स बाइनरी ऑपरेटर्स हैं क्योंकि ये दो ऑपरेंड्स पर कार्य करते हैं।

Let A = 10 and B = 5.

माना कि A = 10 तथा B = 5 हैं।

Types of Arithmetic Operators in C (C में अंकगणितीय ऑपरेटर्स के प्रकार)

The following table represents arithmetic operators, their descriptions, and examples.

निम्न तालिका में अंकगणितीय ऑपरेटर्स, उनके संक्षिप्त विवरण तथा उदाहरण दिए गए हैं।

OperatorDescription (विवरण)Example
+Addition (जोड़)A + B = 15
-Subtraction (घटाव)A - B = 5
*Multiplication (गुणा)A * B = 50
/Division (भाग)A / B = 2
%Modulus – gives the remainder after integer division (पूर्णांक भाग के बाद शेषफल देता है)A % B = 0

1. Addition Operator (+) (जोड़ ऑपरेटर)

The addition operator + is used to add two operands.

Addition ऑपरेटर + का उपयोग दो ऑपरेंड्स को जोड़ने के लिए किया जाता है।

Example:

int A = 10, B = 5;
int C = A + B;
printf("Addition = %d", C);

Output:

Addition = 15

2. Subtraction Operator (-) (घटाव ऑपरेटर)

The subtraction operator - is used to subtract the second operand from the first operand.

Subtraction ऑपरेटर - का उपयोग पहले ऑपरेंड में से दूसरे ऑपरेंड को घटाने के लिए किया जाता है।

Example:

int A = 10, B = 5;
int C = A - B;
printf("Subtraction = %d", C);

Output:

Subtraction = 5

3. Multiplication Operator (*) (गुणा ऑपरेटर)

The multiplication operator * is used to multiply two operands.

Multiplication ऑपरेटर * का उपयोग दो ऑपरेंड्स का गुणा करने के लिए किया जाता है।

Example:

int A = 10, B = 5;
int C = A * B;
printf("Multiplication = %d", C);

Output:

Multiplication = 50

4. Division Operator (/) (भाग ऑपरेटर)

The division operator / is used to divide the first operand by the second operand.

Division ऑपरेटर / का उपयोग पहले ऑपरेंड को दूसरे ऑपरेंड से भाग देने के लिए किया जाता है।

Example:

int A = 10, B = 5;
int C = A / B;
printf("Division = %d", C);

Output:

Division = 2

Important Note:

When both operands are integers, C performs integer division and discards the fractional part.

For example:

int A = 10, B = 3;
printf("%d", A / B);

Output:

3

If you want a fractional result, use floating-point operands.

यदि दोनों ऑपरेंड पूर्णांक हैं, तो C में Integer Division होता है तथा दशमलव भाग हट जाता है। यदि दशमलव परिणाम चाहिए, तो Floating-Point ऑपरेंड्स का उपयोग करें।

Example:

float A = 10.0f, B = 3.0f;
printf("%.2f", A / B);

Output:

3.33

5. Modulus Operator (%) (मॉड्यूलस ऑपरेटर)

The modulus operator % is used to find the remainder after integer division of two integer operands.

Modulus ऑपरेटर % का उपयोग दो पूर्णांक ऑपरेंड्स के भाग के बाद शेषफल ज्ञात करने के लिए किया जाता है।

Example 1:

int A = 10, B = 5;
int C = A % B;
printf("Remainder = %d", C);

Output:

Remainder = 0

Example 2:

int A = 10, B = 3;
int C = A % B;
printf("Remainder = %d", C);

Output:

Remainder = 1

Explanation:

When 10 is divided by 3, the quotient is 3 and the remainder is 1.

जब 10 को 3 से भाग दिया जाता है, तो भागफल 3 तथा शेषफल 1 प्राप्त होता है।

Important Points:

  1. The % operator is used with integer operands in C.

  2. Division or modulus by zero is not valid.

  3. The sign of a non-zero remainder follows the sign of the dividend in C.

महत्वपूर्ण बातें:

  1. C में % ऑपरेटर का उपयोग पूर्णांक ऑपरेंड्स के साथ किया जाता है।

  2. शून्य से भाग देना या शून्य से Modulus करना मान्य नहीं है।

  3. C में शेषफल का चिह्न Dividend के चिह्न के अनुसार होता है।

C Program to Demonstrate Arithmetic Operators

अंकगणितीय ऑपरेटर्स को प्रदर्शित करने वाला C प्रोग्राम

The following program demonstrates all five arithmetic operators using two integer variables.

निम्न प्रोग्राम दो Integer Variables की सहायता से पाँचों अंकगणितीय ऑपरेटर्स को प्रदर्शित करता है।

Program:

#include <stdio.h>
int main(void)
{
int A = 10, B = 5;
printf("Addition = %d\n", A + B);
printf("Subtraction = %d\n", A - B);
printf("Multiplication = %d\n", A * B);
printf("Division = %d\n", A / B);
printf("Modulus = %d\n", A % B);
return 0;
}

Output:

Addition = 15
Subtraction = 5
Multiplication = 50
Division = 2
Modulus = 0

Important Points for Exams (परीक्षाओं के लिए महत्वपूर्ण बातें)

  1. There are five commonly taught basic arithmetic operators in C: +, -, *, /, and %.

  2. The modulus operator % returns the remainder.

  3. Integer division removes the fractional part of the result.

  4. The multiplication operator is represented by *, not ×.

  5. The division operator is represented by /, not ÷.

  6. The modulus operator % requires integer operands.

  7. Division by zero is invalid.

  8. Unary + and unary - are also available in C, but they operate on a single operand.

हिंदी में महत्वपूर्ण बातें:

  1. C में सामान्यतः पाँच मुख्य अंकगणितीय ऑपरेटर्स पढ़ाए जाते हैं: +, -, *, / तथा %।

  2. Modulus ऑपरेटर % शेषफल देता है।

  3. Integer Division में दशमलव भाग हट जाता है।

  4. Multiplication ऑपरेटर को * से दर्शाते हैं, × से नहीं।

  5. Division ऑपरेटर को / से दर्शाते हैं, ÷ से नहीं।

  6. Modulus ऑपरेटर % के लिए Integer Operands आवश्यक हैं।

  7. शून्य से भाग देना मान्य नहीं है।

  8. C में Unary + तथा Unary - भी उपलब्ध हैं, जो केवल एक ऑपरेंड पर कार्य करते हैं।

Arithmetic operators are among the most fundamental operators in C language. They are widely used in mathematical calculations, expressions, and programming logic.

अंकगणितीय ऑपरेटर्स C लैंग्वेज के सबसे महत्वपूर्ण ऑपरेटर्स में से हैं। इनका उपयोग गणितीय गणनाओं, एक्सप्रेशन्स तथा प्रोग्रामिंग लॉजिक में व्यापक रूप से किया जाता है।

Comments

Popular posts from this blog

C Language Topics in Hindi and English

Complete C Programming Syllabus | Advanced C Roadmap for Students

Top High-Paying Tech Skills to Learn in 2025