C Language में Operator क्या है? (Full Guide in Hindi)

Hello दोस्तों! C Programming की दुनिया में आपका स्वागत है। अगर आप C programming सीख रहे हैं, तो आपने operators का नाम ज़रूर सुना होगा। Operator Programming की रीढ़ की हड्डी होते हैं, जिनके बिना कोई भी calculation या decision-making Possible नहीं है।

क्या आपने कभी सोचा है कि जब हम a + b लिखते हैं, तो Computer को कैसे पता चलता है कि उसे इन दोनों variables को जोड़ना है? या फिर, जब हम if (age >= 18) लिखते हैं, तो इस condition का मतलब क्या होता है?

इन सभी सवालों का जवाब Operator है!

आज के इस Full Guide में, हम जानेंगे C Language Me Operator Kya Hai? और C Language में Operator के हर पहलू को इतनी आसानी से समझेंगे कि आपके ये सारे Doubt दूर हो जाएँगे!

1. Operator in C Language क्या है?

C programming में, Operator एक विशेष symbol होता है जिसका उपयोग कुछ Operation करने के लिए किया जाता है।

आसान Word में कहें तो, Operator एक symbol होता है जो कंपाइलर (Compiler) को यह बताता है कि उसे एक या एक से ज़्यादा values या variables पर कोई mathematical या logical operation Perform करना है। ये मान या Variable Operand कहलाते हैं।

उदाहरण के लिए:

  • + एक Operator है जो जोड़ने का काम करता है।
  • > एक Operator है जो Compare करने का काम करता है (चेक करता है कि क्या बाईं ओर का मान दाईं ओर के मान से बड़ा है)।

Operand vs Operator in C

किसी भी expression में, दो मुख्य चीज़ें होती हैं: Operand और Operator

  • Operand: ये वे Value या Variable हैं जिन पर Operator काम करता है।
  • Operator: यह वह symbol है जो Operation को परिभाषित करता है।

उदाहरण:

यदि हमारे पास expression है: result = 10 + 5;

  • Operators: =, +
  • Operands: result, 10, 5

Real-life analogy to Understand Operator in C

एक Calculator को ही ले लीजिए।

  • जब हम 2 और 3 दबाते हैं, तो ये 2 और 3 Operands हैं।
  • जब हम + बटन दबाते हैं, तो यह + Operator है।
  • Operator (+), Operands (2 और 3) पर जोड़ने का Operation करता है।

C Language में Operator Syntax

C में, Operator का Syntax (उपयोग का तरीका) उनके प्रकार पर निर्भर करता है:

  1. Unary Operator :
    • इन्हें केवल एक Operand की ज़रूरत होती है।
    • उदाहरण: ++a, –b
  2. Binary Operator :
    • इन्हें दो Operands की ज़रूरत होती है।
    • उदाहरण: a + b, x > y
  3. Ternary Operator :
    • इन्हें तीन Operands की ज़रूरत होती है।
    • उदाहरण: a > b ? a : b (यह C में केवल एक ही होता है: Conditional Operator)

C Language में Operator Examples

#include<stdio.h>
int main()
{
  int a = 10, b = 5, result;

  // Binary Operator example
  result = a * b; // 10 * 5 = 50
  printf("Multiplication: %d\n", result);

  // Unary Operator example (Post-increment)
  a++; // a becomes 11
  printf("Incremented a: %d\n", a);

  // Binary Operator (Relational) example
  printf("Is a > b? %d\n", a > b); // 11 > 5 is True (Output: 1)

  return 0;
}

Output:
Multiplication: 50
Incremented a: 11
Is a > b? 1

C Language Me Operator Kya Hai

2. C Language में Operators के Types (Complete List with Examples)

C programming में, operators को मुख्य रूप से 8 Categories में बाँटा गया है। इन सभी types of operators in c को जानना ज़रूरी है।

1. Arithmetic Operators in C

ये Operator Mathematical Calculations करने के लिए उपयोग किए जाते हैं।

OperatorNameDescription
+Addition (योग)दो Operands को जोड़ता है।
Subtraction (घटाव)पहले Operand से दूसरे Operand को घटाता है।
*Multiplication (गुणा)दो Operands को गुणा करता है।
/Division (भाग)अंश (Numerator) को हर (Denominator) से भाग देता है।
%Modulus (मॉड्यूलो)भाग देने के बाद का शेषफल (Remainder) लौटाता है।

Arithmetic Operator Example Program in C

#include <stdio.h>

int main() {
    int a = 15, b = 4;

    printf("Addition: %d\n", a + b);
    printf("Subtraction: %d\n", a - b);
    printf("Multiplication: %d\n", a * b);
    printf("Division: %d\n", a / b);      // Integer division
    printf("Modulus: %d\n", a % b);

    return 0;
}

Output:

Addition: 19

Subtraction: 11

Multiplication: 60

Division: 3

Modulus: 3

Common mistakes (integer division trap C Language)

सबसे आम गलती integer division में होती है। जब हम दो integers को भाग देते हैं, तो C हमेशा integer भागफल (quotient) ही देता है, दशमलव (decimal) भाग को छोड़ देता है।

Example:

  • 15 / 4 का Output 3 होगा, 3.75 नहीं।
  • अगर हमें दशमलव में Output चाहिए, तो कम से कम एक Operand को float या double में typecast करना होगा: (float)15 / 4 का Output 3.75 होगा।

2. Relational Operators In C

Relational Operator दो numbers या values को बड़ा, छोटा या बराबर होने के लिए compare करने के लिए उपयोग किया जाता है।

OperatorNameDescription
>Greater Thanक्या बायाँ Value, दाएँ Value से बड़ा है?
<Less Thanक्या बायाँ Value, दाएँ Value से छोटा है?
>=Greater Than or Equal Toक्या बायाँ Value, दाएँ Value से बड़ा या बराबर है?
<=Less Than or Equal Toक्या बायाँ Value, दाएँ Value से छोटा या बराबर है?
==Equal Toक्या दोनों Value बराबर हैं?
!=Not Equal Toक्या दोनों Value बराबर नहीं हैं?

Relational Operator in C Return type explanation (0/1)

Relational operators हमेशा बूलियन (Boolean) Output देते हैं, लेकिन C language में बूलियन Data Type नहीं होता है (C99 से पहले)।

  • यदि तुलना सत्य (True) है, तो Output 1 (या कोई non-zero Value) होता है।
  • यदि तुलना असत्य (False) है, तो Output 0 होता है।

Relational Operator Example in C

#include <stdio.h>

int main() {
    int a = 10, b = 20;

    printf("Is a equal to b? %d\n", a == b);     
    printf("Is a not equal to b? %d\n", a != b);
    printf("Is a greater than b? %d\n", a > b);
    printf("Is a less than b? %d\n", a < b);
    printf("Is a greater than or equal to b? %d\n", a >= b);
    printf("Is a less than or equal to b? %d\n", a <= b);

    return 0;
}

Output:

Is a equal to b? 0

Is a not equal to b? 1

Is a greater than b? 0

Is a less than b? 1

Is a greater than or equal to b? 0

Is a less than or equal to b? 1

3. C Language Logical Operators

Logical Operator एक या ज़्यादा चीज़ों (conditions) को आपस में मिलाते या Comapare करते हैं, ताकि हम Program में कठिन फैसले ले सकें।

OperatorNameDescription
&&Logical ANDअगर दोनों expressions सही हैं, तभी True (1) लौटाता है।
| |Logical ORअगर दोनों expressions में से कोई एक भी सही है, तो यह True (1) return करता है। यह केवल तभी False (0) return करता है जब दोनों expressions गलत (False) हों।
!Logical NOTसही को गलत और गलत को सही में बदल देता है (Negation)।

Logical Operator Truth table with examples

मान लीजिए कि A और B कोई expression हैं।

ABA && BA || B!A
11110
10010
01011
00001

Note: C में 1 का मतलब True और 0 का मतलब False होता है।

Logical Operator Example Program in C

#include <stdio.h>

int main() {
    int a = 1, b = 0;

    printf("a && b = %d\n", a && b);
    printf("a || b = %d\n", a || b);
    printf("!a = %d\n", !a);
    printf("!b = %d\n", !b);

    return 0;
}

Output:

a && b = 0

a || b = 1

!a = 0

!b = 1

4. C Assignment Operators

Assignment Operator एक Value या expression के Result को बाईं ओर के variable में Assign (store) करने के लिए उपयोग किए जाते हैं।

OperatorExampleEquivalent toDescription
=a = 10;a = 10;Value को Assign करता है। (Simple Assignment)
+=a += 5;a = a + 5;जोड़कर Assign करता है।
-=a -= 3;a = a – 3;घटाकर Assign करता है।
*=a *= 2;a = a * 2;गुणा करके Assign करता है।
/=a /= 4;a = a / 4;भाग देकर Assign करता है।
%=a %= 3;a = a % 3;शेषफल (Remainder) Assign करता है।

C Language Assignment Operator Use Cases

ये Operator (Compound assignment operators) हमारे Program को छोटा और साफ़-सुथरा बनाते हैं, जिससे Code को पढ़ना और समझना आसान हो जाता है।

Assignment Operator Example in C

#include <stdio.h>

int main() {
    int a = 10;

    printf("Initial value of a: %d\n", a);

    a += 5;   // a = a + 5
    printf("After a += 5: %d\n", a);

    a -= 3;   // a = a - 3
    printf("After a -= 3: %d\n", a);

    a *= 2;   // a = a * 2
    printf("After a *= 2: %d\n", a);

    a /= 4;   // a = a / 4
    printf("After a /= 4: %d\n", a);

    a %= 3;   // a = a % 3
    printf("After a %%= 3: %d\n", a);

    return 0;
}

Output:

Initial value of a: 10

After a += 5: 15

After a -= 3: 12

After a *= 2: 24

After a /= 4: 6

After a %= 3: 0

5. Increment & Decrement Operators C Programming

ये Unary operators हैं, जो Operand के Value को एक (1) से बढ़ाते हैं (Increment) या घटाते हैं (Decrement)।

ऑपरेटरनामविवरण
++IncrementValue को 1 से बढ़ाता है।
DecrementValue को 1 से घटाता है।

इनके दो रूप होते हैं, जिनमें Beginners सबसे ज़्यादा confuse होते हैं:

  1. Prefix (प्रीफिक्स): Operator Operand से पहले आता है (++x, –x)।
  2. Postfix (पोस्टफिक्स): Operator Operand के बाद आता है (x++, x–)।

Pre vs post difference

सबसे ज़रूरी अंतर है कि Value कब बदलता है:

  • Pre-increment (++x): पहले Value बढ़ती है, फिर उस नए Value का उपयोग expression में किया जाता है।
  • Post-increment (x++): पहले expression में पुराने Value का उपयोग किया जाता है, फिर Value बढ़ती है।

Increment and Decrement Operator Example in C

#include <stdio.h>

int main() {
    int a = 5, b = 5;

    // Pre-Increment: पहले value बढ़ती है, फिर print होती है
    printf("Pre-Increment  -> a = %d, ++a = %d\n", a, ++a);

    // Post-Increment: पहले value print होती है, फिर बढ़ती है
    printf("Post-Increment -> b = %d, b++ = %d\n", b, b++);

    // Values reset for decrement example
    a = 5;
    b = 5;

    // Pre-Decrement: पहले value घटती है, फिर print होती है
    printf("Pre-Decrement  -> a = %d, --a = %d\n", a, --a);

    // Post-Decrement: पहले value print होती है, फिर घटती है
    printf("Post-Decrement -> b = %d, b-- = %d\n", b, b--);

    return 0;
}

Output:

Pre-Increment  -> a = 5, ++a = 6

Post-Increment -> b = 5, b++ = 5

Pre-Decrement  -> a = 5, –a = 4

Post-Decrement -> b = 5, b– = 5

6. Bitwise Operators in C Programming

ये Operator (Bitwise Operators) संख्याओं (integers) के सबसे अंदरूनी और छोटे हिस्सों (bits/0 और 1) पर सीधे काम करते हैं। ये थोड़े मुश्किल ज़रूर होते हैं, पर ये बहुत Useful होते हैं।

OperatorNameDescription
&Bitwise ANDहर bit की AND तुलना करता है। दोनों bits 1 हों तभी result 1 आता है।
|Bitwise ORअगर दोनों Bit 0 है तभी result 0 होगा वरना result 1 होगा 
^Bitwise XORअगर दोनों bits अलग-अलग हों तो 1 Return करता है, वरना 0
~Bitwise NOTहर bit को उलट देता है (0 → 1, 1 → 0)। यह Unary operator है।
<<Left Shiftbits को बाईं तरफ Shift करता है। हर shift पर value 2 से multiply होती है।
>>Right Shiftbits को दाईं तरफ Shift करता है। हर shift पर value 2 से divide होती है।

Bitwise Operations In C Truth Table

मान लें: A = 5 (0101), B = 3 (0011)

OperationA (0101)B (0011)Result (बाइनरी)Result (दशमलव)
A & B0101001100011
A | B0101001101117
A ^ B0101001101106
A << 10101Not Used101010
A >> 10101Not Used00102
~A0101Not Used101010

Best for: embedded, competitive coding

Bitwise operators का उपयोग मुख्य रूप से:

  • Embedded Systems और माइक्रोकंट्रोलर programming में Flags या Hardware Registers को नियंत्रित करने के लिए।
  • Competitive Coding में तेज़ी से गुणा (Left Shift) और भाग (Right Shift) करने के लिए किये जाते हैं।

C Bitwise Operator Example Program (With Binary Output)

#include <stdio.h>

// Function to print 8-bit binary value
void printBinary(int n) {
    int i;
    for (i = 7; i >= 0; i--) {
        printf("%d", (n >> i) & 1);
    }
}

int main() {
    int A = 5;   // 00000101
    int B = 3;   // 00000011

    printf("A = %d (Binary: ", A);
    printBinary(A);
    printf(")\n");

    printf("B = %d (Binary: ", B);
    printBinary(B);
    printf(")\n\n");

    printf("A & B  = %d (Binary: ", A & B);
    printBinary(A & B);
    printf(")\n");

    printf("A | B  = %d (Binary: ", A | B);
    printBinary(A | B);
    printf(")\n");

    printf("A ^ B  = %d (Binary: ", A ^ B);
    printBinary(A ^ B);
    printf(")\n");

    printf("~A     = %d (Binary: ", ~A);
    printBinary(~A);
    printf(")\n");

    printf("A << 1 = %d (Binary: ", A << 1);
    printBinary(A << 1);
    printf(")\n");

    printf("A >> 1 = %d (Binary: ", A >> 1);
    printBinary(A >> 1);
    printf(")\n");

    return 0;
}

Output:

A = 5 (Binary: 00000101)

B = 3 (Binary: 00000011)

A & B  = 1 (Binary: 00000001)

A | B  = 7 (Binary: 00000111)

A ^ B  = 6 (Binary: 00000110)

~A     = -6 (Binary: 11111010)

A << 1 = 10 (Binary: 00001010)

A >> 1 = 2 (Binary: 00000010)

7. Conditional (Ternary) Operator In C

यह C Programming का इकलौता ऐसा Operator है जिसे काम करने के लिए तीन चीज़ों (Operands) की ज़रूरत होती है।

इसे हम if-elseStatement का एक छोटा और तेज़ तरीक़ा भी कह सकते हैं। यह एक ही लाइन में किसी Condition के आधार पर फ़ैसला लेने में मदद करता है।

Ternary Operator Syntax In C

Ternary Operator का Syntax कुछ ऐसा होता है:

Condition ? अगर Condition True है तो यह करो : अगर Condition गलत है तो यह करो

Ternary Operator Example in C 

#include <stdio.h>

int main() {
    int number;

    printf("Enter a number: ");
    scanf("%d", &number);

    // Ternary operator to check big or small number
    number >= 50 ? printf("Big\n") : printf("Small\n");

    return 0;
}

Output:

Enter a number: 75

Big

8. Special Operators in C

C में कुछ अन्य Operator भी हैं जो कुछ खास काम करते हैं:

OperatorNameDescription
sizeofSizeof Operatorकिसी variable या data type के बाइट्स (Bytes) में साइज (Size) बताता है। (Unary)
,Comma Operatorकई expressions को chain करता है; अंतिम expression का Value लौटाता है।
&Address-of OperatorVariable का Memory Address देता है। (Unary)
*Dereference OperatorPointer में stored address पर value को access करता है। (Unary)
.Member Access OperatorStructure या Union के members को access करता है।
->Pointer Member Access OperatorPointer के माध्यम से Structure या Union के members को access करता है।

Special Operators in C – Complete Example Program

#include <stdio.h>

// Structure definition
struct Student {
    int id;
    float marks;
};

int main() {

    /* sizeof operator */
    int num = 10;
    printf("Size of int: %zu bytes\n", sizeof(num));

    /* Address-of (&) and Dereference (*) operators */
    int *ptr = & num;
    printf("Address of num: %p\n", (void *)&num);
    printf("Value using pointer: %d\n", *ptr);

    /* Comma operator */
    int a = 5, b = 5, c;
    c = (a++, b--);   // a increment होगा, b decrement होगा, value b-- की assign होगी
    printf("After comma operator -> c: %d, a: %d, b: %d\n", c, a, b);

    /* Structure and Member Access (.) operator */
    struct Student s1;
    s1.id = 101;
    s1.marks = 85.5;
    printf("Student ID (using .): %d\n", s1.id);
    printf("Student Marks (using .): %.1f\n", s1.marks);

    /* Pointer Member Access (->) operator */
    struct Student *sptr = &s1;
    printf("Student ID (using ->): %d\n", sptr->id);
    printf("Student Marks (using ->): %.1f\n", sptr->marks);

    return 0;
}

Output:

Size of int: 4 bytes
Address of num: 0061FF08
Value using pointer: 10
After comma operator -> c: 5, a: 6, b: 4
Student ID (using .): 101
Student Marks (using .): 85.5
Student ID (using ->): 101
Student Marks (using ->): 85.5

3. Operator Precedence and Associativity in C (Table + Examples)

जब एक ही expression में कई operators होते हैं, तो compiler को यह जानना होता है कि किस operator को पहले evaluate करना है। यहीं पर Precedence और Associativity काम आते हैं।

Precedence chart (table form)

Operator Precedence यह तय करता है कि कौन सा Operator कितना मजबूत है। उच्च Precedence वाला Operator पहले Evaluate होता है।

No.OperatorDescriptionAssociativity
1() [] -> . ++ — (Postfix)Primary & PostfixLeft to Right
2++ — ! ~ (type) * & sizeofUnaryRight to Left
3* / %Multiplicative (गुणा, भाग, मॉड्यूलो)Left to Right
4+ –Additive (योग, घटाव)Left to Right
5<< >>Shift (शिफ्ट)Left to Right
6< <= > >=Relational (तुलना)Left to Right
7== !=Equality (समानता)Left to Right
8&Bitwise ANDLeft to Right
9^Bitwise XORLeft to Right
10|Bitwise ORLeft to Right
11&&Logical ANDLeft to Right
12||Logical ORLeft to Right
13?:Conditional (Ternary)Right to Left
14= += -= *= /= %=AssignmentRight to Left
15,Comma OperatorLeft to Right

C में Operator Precedence क्यों ज़रूरी है?

प्राथमिकता (Precedence) एक तरह का नियम है जो बताता है कि जब एक ही लाइन के Code में कई Operator हों, तो पहले कौन सा Operation होगा।

Precedence इसलिये जरुरी है, क्योंकि C compiler expressions को उसी order में evaluate करता है, और अगर precedence समझ में नहीं है तो program गलत output देगा, भले ही syntax सही हो।

उदाहरण: मान लीजिए हमने लिखा: a + b * c

अगर कोई नियम नहीं होता, तो:

  1. कुछ लोग पहले a + b करके, फिर c से गुणा करते: (a + b) * c
  2. और कुछ लोग पहले b * c करके, फिर a जोड़ते: a + (b * c)

C का नियम (Precedence): गुणा (*) की प्राथमिकता जोड़ (+) से ज़्यादा होती है।

  • इसलिए, C हमेशा पहले b * c करेगा। यानी, यह हमेशा a + (b * c) के रूप में Evaluate होगा।

C Language में Associativity) क्या है?

जब दो Operators की प्राथमिकता (Precedence) बराबर होती है, तो Associativity तय करती है कि Calculation बाएँ से शुरू होगी या दाएँ से

1. बाएँ से दाएँ (Left to Right)

  • उदाहरण: a / b * c
    • भाग (/) और गुणा (*) दोनों की प्राथमिकता बराबर होती है।
    • इनकी Associativity बाएँ से दाएँ है।
    • इसलिए, पहले (a / b) होगा, और फिर उसका परिणाम c से गुणा होगा।

2. दाएँ से बाएँ (Right to Left)

  • उदाहरण: a = b = 10
    • Assignment Operator (=) की Precedence बराबर होती है।
    • इसकी Associativity दाएँ से बाएँ है।
    • इसलिए, पहले b = 10 होगा, और फिर a को b का Value मिलेगा।

Common errors and pro tips

  • सबसे बड़ी गलती:
    Operator Precedence के नियमों को याद करने पर ज़रूरत से ज़्यादा निर्भर रहना।
  • Pro Tip:
    जब भी Expression थोड़ा भी complex हो, तो हमेशा कोष्टक (()) का उपयोग करें।
  • उदाहरण:
    यदि आप चाहते हैं कि a और b पहले जुड़ें, तो साफ़-साफ़ लिखें:
    (a + b) * c इससे code ज़्यादा readable बनता है और किसी को भी
    operator precedence याद रखने की ज़रूरत नहीं पड़ती।

4. Operator vs Expression In C : इन दोनों में क्या अंतर है?

C programming में Operator और Expression के बीच का अंतर समझना बहुत ज़रूरी है।

  • Operator: यह एक symbol है जो एक विशेष action को परिभाषित करता है। (जैसे: +, -, *)
  • Expression: यह Operands और Operators का एक Combination है जो Evaluate होने पर एक value)  देता है।

Practical examples

CategoryExampleDescription
Operator+यह बताता है कि जोड़ना है।
Operand10, aये वे मान हैं जिन पर कार्रवाई की जाती है।
Expression10 + aयह पूरा संयोजन है जो एक नया मान देता है।

एक Expression के अंत में जब हम ; (Semicolon) लगाते हैं, तो वह एक Statement बन जाता है।

  • a + 5 → Expression
  • a + 5; → Statement

Operator vs Expression in C – Example Program

#include <stdio.h>

int main() {
    int a = 10, b = 5;
    int result;

    /* Operator Example
       + और * यहाँ Operators हैं
    */
    result = a + b;        // + एक operator है
    printf("Result of a + b = %d\n", result);

    /* Expression Example
       a + b और a * b दोनों Expressions हैं
       क्योंकि ये evaluate होकर value return करते हैं
    */
    result = a * b;        // a * b एक expression है
    printf("Result of a * b = %d\n", result);

    /* Relational Expression */
    if (a > b) {           // a > b एक expression है (True/False देता है)
        printf("a is greater than b\n");
    }

    return 0;
}

Output:

Result of a + b = 15

Result of a * b = 50

a is greater than b

5. C Operators: Quiz for Self-Test

अपने ज्ञान को Test करें!

C Operators Quiz

Q1. int x = 10; printf("%d", x++); का output क्या होगा?

A) 10
B) 11
C) 9
D) Error
Answer: A Reason: Post-increment (x++) पहले value print करता है, बाद में increment करता है।

Q2. C language में Ternary Operator कौन सा है?

A) ? :
B) ?:
C) !=
D) &&
Answer: A Reason: Ternary operator का syntax होता है: condition ? true : false

Q3. int a = 5; int b = 2; printf("%d", a % b); का output क्या होगा?

A) 2.5
B) 2
C) 1
D) 0
Answer: C Reason: Modulus operator remainder देता है। 5 ÷ 2 का remainder = 1।

Q4. Operator precedence के अनुसार पहले कौन evaluate होता है: + या *?

A) +
B) *
C) दोनों एक साथ
D) Associativity पर निर्भर करता है
Answer: B Reason: Multiplication (*) की precedence addition (+) से ज्यादा होती है।

Q5. Logical OR operator कौन सा है?

A) &
B) |
C) &&
D) ||
Answer: D Reason: Logical OR operator || होता है, जो boolean conditions के लिए use होता है।

6. FAQs: C Operators से जुड़े सामान्य सवाल

Q1. C Language में कुल कितने प्रकार के operators होते हैं?

Ans: C language में मुख्य रूप से 8 प्रकार के operators होते हैं।

Arithmetic, Relational, Logical, Assignment, Increment/Decrement, Bitwise, Conditional (Ternary) और Special Operators।

Q2. Pre-increment और Post-increment में क्या अंतर है?

Ans:

Pre-increment (++x): पहले value को 1 से बढ़ाता है, फिर बढ़ी हुई value को expression में use करता है।

Post-increment (x++): पहले current value को expression में use करता है, फिर value को 1 से बढ़ाता है।

Q3. Logical और Bitwise operator में क्या फर्क है?

Ans:

Logical Operators (&&, ||, !) पूरे operands को boolean value (1 या 0) के रूप में evaluate करते हैं।

Bitwise Operators (&, |, ^ आदि) operands के individual bits पर operation करते हैं।

Q4. क्या C में exponentiation operator होता है?

Ans: नहीं। C language में कोई direct exponentiation operator नहीं होता।

Power calculation के लिए pow() function का उपयोग किया जाता है, जो math.h library में होता है।

Q5. sizeof operator क्या return करता है?

Ans: sizeof operator किसी variable या data type का size bytes में return करता है।

इसका return type आमतौर पर size_t होता है।

Q6. क्या assignment operator chaining संभव है?

Ans: हाँ, assignment operator chaining संभव है।

क्योंकि assignment operator (=) right to left associative होता है और assigned value को return करता है।

Example: a = b = c = 10;

Q7. Relational operators का output true/false होता है या 1/0?

Ans: C language में relational operators का output 1 (True) या 0 (False) होता है।

C99 के बाद _Bool datatype और stdbool.h library उपलब्ध है, लेकिन core C में result integer 1 या 0 ही होता है।

7. Conclusion — C Operators समझना क्यों जरूरी है?

दोस्तों, इस exhaustive guide में, आपने C language men operator kya hai ? और C Programming में Operators की पूरी दुनिया को कवर कर लिया है। हमने न केवल हर operator के types और examples को समझा, बल्कि Precedence, Associativity, और कुछ Important faqs और Quizzes भी देखा। 

C programming में Operators को समझना इसलिए ज़रूरी है क्योंकि ये:

  1. हमारे Code को functional बनाते हैं।
  2. Complex logic को लागू करने में मदद करते हैं।
  3. Calculations और Decision Making का आधार हैं।

अब आप इस ज्ञान का उपयोग करके C programming में अधिक effective और error-free code लिख सकते हैं। Operators पर अपनी पकड़ मजबूत रखें, और आप एक बेहतर C programmer बन जाएँगे!

और साथ ही साथ इस Post को Share करके और लोगों को सीखने में मदद कर सकते हैं !

Thanks For Visiting Anwarcodes.com!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top