Solved programming problem

How to do Add, subtract, multiplication, divided, remainder in C.

Source code

#include <stdio.h>

int main()

{

    int a,b,add,subtract,multiplication,divided,remainder;

   printf("Please Enter the 1st Number: ");

   scanf("%d",&a);

   printf("Please Enter the 2nd Number: ");

   scanf("%d",&b);

   add=a+b;

   subtract=a-b;

   multiplication=a*b;

   divided=a/b;

   remainder=a%b;

    printf("Sum: %dDifference: %d",add,subtract);

    printf("Multiplication: %dDivided: %dRemainder: %d",multiplication,divided,remainder);

    return 0;

}

Output

Please Enter the 1st Number:  10

Please Enter the 2nd Number: 5

 

Sum: 15

Difference:  5

Multiplication: 50

Divided: 2

Remainder: 0

Join the discussion

Add your comment