Posts

Showing posts with the label Subtraction

C Program to Calculate Addition, Subtraction, Multiplication and Division of Two Numbers दो संख्याओं का जोड़, घटाव, गुणा एवं भाग ज्ञात करने का प्रोग्राम

In C language, arithmetic operators are used to perform mathematical operations such as addition, subtraction, multiplication, and division on two numbers. सी लैंग्वेज में दो संख्याओं पर जोड़, घटाव, गुणा एवं भाग जैसी गणितीय क्रियाएँ करने के लिए अर्थमैटिक ऑपरेटर्स का प्रयोग किया जाता है। Arithmetic Operators अर्थमैटिक ऑपरेटर्स Operator Operation ऑपरेशन + Addition जोड़ - Subtraction घटाव * Multiplication गुणा / Division भाग C Program #include <stdio.h> int main(void) { float a, b, ans; printf("Enter two numbers:\n"); scanf("%f %f", &a, &b); ans = a + b; printf("Addition = %f\n", ans); ans = a - b; printf("Subtraction = %f\n", ans); ans = a * b; printf("Multiplication = %f\n", ans); if (b != 0) { ans = a / b; printf("Division = %f\n", ans); } else { printf("Divisor must be a non-zero value.\n"); } return 0; } Output Ent...