Question

Write a program in C for arithmetic operations between two integers. Your program should guide users with proper message/menu on the console.

30 Nov 2017
Answer :
Word Count : 439

```c
#include <stdio.h>

int main() {
    int num1, num2, choice;
    int result;

    // Display the menu to the user
    printf("Select an operation:\n");
    printf("1. Addition\n");
    printf("2. Subtraction\n");
    printf("3. Multiplication\n");
    printf("4. Division\n");
    printf("Enter your choice (1-4): ");
    scanf("%d", &choice);

    // Get two integers from the user
    printf("Enter two integers: ");
    scanf("%d %d", &num1, &num2);

    // Perform the chosen operation
    switch (choice) {
        case 1:
            result = num1 + num2;
            printf("Result: %d + %d = %d\n", num1, num2, result);
 

______ _________ _____ _________ ___ _________ ___ ___ ___ ________ ___ _____.
___ ______ __________ ______ ____ ______ _______ _______ _____.
______ ___ _________ ____ ___ _________ ___ ____.
___ ________ ______ _______ ________.
________ ______ ________ ________ _______ _________ __________ _________ ____.
_____ _______ ____ _____ _________ ____ __________ _________ _______ ________ ____.
__________ ____ __________ __________ _________ _____.
______ _______ ___ ______ _______ __________ _______.
____ __________ _______ __________ _____ ____ ______ __________ _________ _________ _________.
______ _________ ______ __________ _____ __________ ___ ____ ______ ____ ________ __________.
______ __________ _________ _________ __________ _______.
__________ _______ _______ _________ __________.
__________ _________ ____ ___ __________ _____ ___ ___.
________ ____ _________ _______ _________ _______ __________ _________ __________.
_______ ________ __________ _________ ________ ________ ______ _____ _____ ________ ________.
____ ____ ___ ______ _____ _________ ____ _________ _______ __________ _____ ____.
____ ________ ______ _________ _______ _____.
____ _____ ______ _______ ___ __________ _________ _____ _______ _________ _______.
_______ _____ _____ ___ _________.
_______ ______ ___ ________ ________ _______ __________ _______ ______ _______ ______.
________ ____ _______ ______ ____ ____ _________ ______ _______ __________.
__________ _____ ___ _____ __________ __________ _________ __________ ________ _________ ____ _______.
__________ __________ ______ ________ ______ _____ ___ ______ ___.
_____ __________ ________ ______ ________ _________ ______ _________ ______ ___ __________ ___.
___ _______ _________ _______ ____.
________ ____ ________ _____ ________ ________ ______.
_____ ____ ______ __________ ________ ______ __________ ________ _____ _______ ____ ______.
________ ______ ______ ________ __________ __________ ____ __________.
_____ _______ _____ ___ ________ ________ ___ ______ ______ __________ ____ _________.
_____ ___ ___ __________ __________.
____ __________ _________ _____ ________.
____ ________ ___ ________ _______.
____ ____ ________ _____ _________ _______ ________ _____ ___ _______ ______ _________.
__________ ___ _____ ____ ____ _________ _____ _____ __________ __________ __________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 11 2010 - Write a program in C for arithmetic operations between two integers. Y | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→