C program to illustrate Airthmatic operators


Levels of difficulty: / perform operation:

C program to compute the addition, subtraction, product, quotient and remainder of two given numbers.

C Program

#include <stdio.h>
#include <conio.h>
void main()
{
	int n1,n2,add,sub,prod,quot,remain;
	clrscr();
	printf("\nENTER NUMBER 1: " );
	scanf("%d",&n1);
	printf("\nENTER NUMBER 2: " );
	scanf("%d",&n2);
	add=n1+n2;
	sub=n1-n2;
	prod=n1*n2;
	quot=n1/n2;
	remain=n1%n2;
	printf("\nADDITION OF THE NUMBERS: %d",add);
	printf("\nSUBSTRACTION OF THE NUMBERS: %d",sub);
	printf("\nPRODUCTION OF THE NUMBERS: %d",prod);
	printf("\nQUOTIENT OF THE NUMBERS: %d",quot);
	printf("\nREMAINDER OF THE NUMBERS: %d",remain);
	getch();
}


Output







Quantitative Aptitude
Reasoning
Programming
Interview