Arithmetic Operators in c# In Hindi

Arithmetic Operators in c# In Hindi

C# प्रोग्रामिंग लैंग्वेज में अरिथमेटिक ऑपरेटर्स का यूज़ बेसिक मैथमेटिकल ऑपरेशन्स जिसमे ऐड, सब्सट्रैक्ट, मल्टिप्लाय, डिवीज़न, रिमाइंडर, इंक्रीमेंट, और डेक्रीमेंट जैसे मैथमेटिकल न्यूमेरिकल डाटा ऑपरेशन परफॉर्म करने में किया जाता है। C# में पॉपुलर अरिथमेटिक न्यूमेरिकल डाटा ऑपरेटर्स में +, -, *, /, %, ++, — आदि है.

Arithmetic Operators in c# In Hindi

List of popular arithmetic operators in the C# programming language.

OperatorOperator DetailArithmetic ExampleArithmetic output
+Addition (use to add 2 different integer variable)p + qAdd total of p and q variable value
Subtraction (use to subtract larger number with small number variable)p – qSubtract of p and q variable value
*Multiplication (use to multiply two different number variable)p * qMultiply of p and q variable value
/Division (use to divide smaller number with larger number variable)p / qDivision of p divided by q variable value
%Modulus (Remainder) (use to divide larger number with small number variable if remainder produce then it displays)p % qRemainder of p divided by q variable value
++Increment (use to increment number of variable value)p ++ or ++ pIncreases p variable value by 1
Decrement (use to decrement number of variable value)p — or — pDecreases p variable value by 1

Examples of popular arithmetic operators in the C# programming language.

using System;

class ArithmeticOperator

{

static void Main()

{

int p = 24;

int q = 7;

Console.WriteLine($”The Addition of p & q – {p + q}”);           // Result is – 31

Console.WriteLine($”The Subtraction of p & q – {p – q}”);        // Result is – 17

Console.WriteLine($”The Multiplication of p & q – {p * q}”);     // Result is – 168

Console.WriteLine($”The Division of p & q – {p / q}”);           // Result is – 3 (integer division of both variable)

Console.WriteLine($”The Modulus of p & q – {p % q}”);            // Result is – 3

p++;  // here it Increment variable value by 1

Console.WriteLine($”After Increment value of p – {p}”);        // Result is – 25

q–;  // here it Decrement variable value by 1

Console.WriteLine($”After Decrement of value q – {q}”);        // Result is – 6

}

}

Important Notes in C# Programming Language.

डिवीज़न अरिथमेटिक ऑपरेटर्स का बिहेवियर।

C# प्रोग्राम में इंटीजर डिवीज़न (int p = 11 / 4;) वेरिएबल के एक डेसिमल पार्ट को छोटा कर डिस्प्ले करता है।

यहाँ डेसिमल के साथ प्रॉपर डिवीज़न ऑपरेशन के लिए डबल या फ्लोट डाटा टाइप का यूज़ करें।

double output = 11.0 / 4.0; // output is – 2.75…

Post-increment (a++) vs. pre-increment (++a) operator in a C#.

  • Post-increment – C# प्रोग्राम में डिक्लेअर प्रोग्राम वेरिएबल वैल्यू को उसकी करंट वैल्यू का यूज़ कर एक से इनक्रीस करता है।
  • Pre-increment – C# प्रोग्राम में डिक्लेअर प्रोग्राम वेरिएबल वैल्यू को उसकी वैल्यू का यूज़ करने से पहले उसे इनक्रीस करता है।

Increment Operator Example.

using System;

class IncrementOperator

{

static void Main()

{

int p = 9;

Console.WriteLine(p++); // Result is – 9 (then p variable value becomes 10)

Console.WriteLine(++p); // Result is – 11

}

}

Decrement Operator Example.

using System;

class DecreamentOperator

{

static void Main()

{

int p = 9;

Console.WriteLine(p–); // Result is – 9 (then p becomes 8)

Console.WriteLine(–p); // Result is – 7 (p is first decremented to 7)

}

}

Uses of the modulus operator (%) in C#.

C# प्रोग्राम में ज्यादातर किसी वेरिएबल की रेंज में डिविज़िबिलिटी या कंडीशन को टेस्ट करने के लिए रिमाइंडर ऑपरेटर का यूज़ किया जाता है, यदि वैल्यू पूर्ण डिवाइड हो जाती है. तो रिमाइंडर नहीं होगा और आउटपुट ट्रू वैल्यू होगा, अन्यथा आउटपुट फाल्स होगा।

modulus operator (%) example.

using System;

class Remainder

{

static void Main()

{

Console.WriteLine(11 % 3 == 0); // Result is – False he here (11 is not complete divisible by 3)

}

}

Leave a Reply