C Program to find sum, multiply, divide and remainder of two numbers

Make a simple C program to find the sum (addition), multiply, subtract, divide and remainder of two numbers. C program will be as follows –

/*C program to find remainder(modulus), sum, subtract, multiply and divide two numbers */
void main()
     int a,b,sum,sub,mul,rem;
     float division;

     printf("Enter any two numbers a and b to sum, subtract, multiply, divide and find remainder of these two numbers\n");


     printf("\n Sum of %d and %d is \t %d",a,b,sum);
     printf("\n Subtraction of %d and %d is \t %d",a,b,sub);
     printf("\n Multiplication of %d and %d is \t %d",a,b,mul);
     printf("\n Division of %d and %d is \t %f",a,b,division);
     printf("\n remainder of %d and %d is \t %d",a,b,rem);

Input – Enter any two numbers- 5   4
Sum is  – 9
Subtraction – 1
Multiplication – 20
Division – 1.25
Modulus is 1


  1. jeeva khan says:

    please……………. learn do you c me

  2. Soman Khan says:

    What if a is any number and b is zerO?

    please reply me im stuck on this problem…

    • yashan says:

      If any number is zero then it will perform operations with zero only. It’s simple. Like an example –

      a = 5 and b = 0
      sum = 5
      subtraction = 5
      multiplication = 0
      and so on…

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This