Answer to Question #274634 in C++ for khan

Question #274634

Write a C program to perform addition, subtraction, multiplication and division of two integer numbers, respectively 2 and 6 and show the result on the screen. 


1
Expert's answer
2021-12-07T09:33:13-0500
#include <stdio.h>
#include <stdlib.h>


int main(){
	int number1;
	int number2;
	int sum;
	int difference;
	int product;
	float div;


	printf("Enter the number 1: ");
	scanf("%d",&number1);
	printf("Enter the number 2: ");
	scanf("%d",&number2);
	sum=number1+number2;
	printf("Sum = %d\n",sum);
	difference=number1-number2;
	printf("Difference = %d\n",difference);
	product=number1*number2;
	printf("Product = %d\n",product);
	div=(float)number1/(float)number2;
	printf("Quotient = %.2f\n\n",div);




	getchar();
	getchar();
	return 0;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment