# C Arithmetic Program — Sum, Product, Difference, Quotient, Remainder

Question: Write a program that asks the user to enter two numbers, obtains them from the user and prints their sum, product, difference, quotient and remainder.

```/*
* Author: AGHATISE OSAZUWA
* Website: www.cscprogrammingtutorials.com
*
* Program to calculate the sum, product, difference, quotient and remainder
* of two numbers entered by the user.
*/

#include <stdio.h>
int main (){
int num1, num2, sum, prod, diff, quot, rem;
puts("Enter two numbers: ");
scanf("%d%d", &num1, &num2);
sum = num1 + num2;
prod = num1 * num2;
diff = num1 - num2;
quot = num1 / num2;
rem = num1%num2;
printf("The sum of %d and %d is %d.\n", num1, num2, sum);
printf("The product of %d and %d is %d.\n", num1, num2, prod);
printf("The difference of %d and %d is %d.\n", num1, num2, diff);
printf("The quotient of %d and %d is %d.\n", num1, num2, quot);
printf("The remainder of %d and %d is %d.\n", num1, num2, rem);
return 0;
}
```

 Program output
Click here to see other solutions to Deitel C How To Program exercises.

1. where is the quotient line?

1. Thanks for pointing that out. I've added it.

2. Please need a procedure of a c program that accepts two numbers from the user computes their product and sum

3. Is great thinkly in person

DISCLAIMER: Opinions expressed in comments are those of the comment writers alone and does not reflect or represent the views of the post author. We reserve the right to delete any post deemed inappropriate or offensive and/or spammy. Please do not use abusive words/hate speech.

I Appreciate your valuable Feedback. So, Please DO NOT SPAM - Spam comments will be deleted immediately.

Don't use brand name in name field and you're not allowed to use links in comments unless it's necessary. Such comments will be removed immediately. To get notified of replies or follow-up comments, click the box next to notify me.

Thanks.