Computer Science, asked by vijayamohan67, 3 months ago

Write a program that prompts the user to enter two integers and then to find the sum, product, difference, quotient, and remainder after division. Display all in a proper format.

Answers

Answered by gksoftnick99
10

Answer:

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

#include<stdio.h>

int main()

{

int a,b,sum,product,diff,quotient,remainder;

printf("Enter 1st number : ");

scanf("%d",&a);

printf("Enter 2nd number : ");

scanf("%d",&b);

sum=a+b;

product=a*b;

diff=a-b;

quotient=a/b;

remainder=a%b;

printf("Sum is : %d",sum);

printf("\nProduct is : %d",product);

printf("\nDifference is : %d",diff);

printf("\nQuotient is : %d",quotient);

printf("\nRemainder is : %d",remainder);

return 0;

}

Explanation:

Output :

Enter 1st number : 200

Enter 2nd number : 50

Sum is : 250

Product is : 10000

Difference is : 150

Quotient is : 4

Remainder is : 0

Hope it will help u....

Answered by Oreki
4

\textsf{\Large Algorithm}

  • \textsf{\small Accepting the numbers using the \textbf{Scanner} class.}
  • \textsf{\small Performing the specified operations on the accepted numbers.}
  • \textsf{\small Displaying the result.}
Attachments:
Similar questions