C++ Arithmetic Operators
➕➖✖️➗ C++ Arithmetic Operators
Arithmetic Operators ka use mathematical calculations ke liye hota hai jaise addition, subtraction, multiplication, division, etc.
🔹 1. List of Arithmetic Operators
| Operator | Name | Example |
|---|---|---|
+ |
Addition | a + b |
- |
Subtraction | a - b |
* |
Multiplication | a * b |
/ |
Division | a / b |
% |
Modulus (remainder) | a % b |
🔹 2. Addition (+)
Output:
🔹 3. Subtraction (-)
Output:
🔹 4. Multiplication (*)
Output:
🔹 5. Division (/)
Integer Division
Output:
Floating Division
Output:
🔹 6. Modulus (%)
Output:
⚠️ % sirf integer types ke liye hota hai.
🔹 7. Arithmetic with Variables
🔹 8. Combined Example
❌ Common Mistakes
✔ Fix:
📌 Summary
-
Arithmetic operators math operations ke liye
-
/integer division me decimal drop hota hai -
%sirf integers ke liye -
Type casting se accurate result milta hai
