C Programming Code Examples C > Beginners Lab Assignments Code Examples C program to perform all arithmetic operations C program to perform all arithmetic operations Write a C program to input two numbers and perform all arithmetic operations. How to perform all arithmetic operation between two numbers in C programming. C program to find sum, difference, product, quotient and modulus of two given numbers. #include <stdio.h> int main() { int number1, number2; int sum, sub, mult, mod; float div; /* * Input two numbers from user */ printf("Enter any two numbers: "); scanf("%d%d", &number1, &number2); /* * Perform all arithmetic operations */ sum = number1 + number2; sub = number1 - number2; mult = number1 * number2; div = (float)number1 / number2; mod = number1 % number2; /* * Print result of all arithmetic operations */ printf("SUM = %d\n", sum); printf("DIFFERENCE = %d\n", sub); printf("PRODUCT = %d\n", mult); printf("QUOTIENT = %f\n", div); printf("MODULUS = %d", mod); return 0; }