SO HERE IS THE PROGRAM:
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f;
clrscr();
printf("Enter two numbers to add\n');
scanf("%d%d",&a,&b);
c=a+b;
printf("\nThe result of addition is %d",c);
printf("Enter two numbers to sub\n');
scanf("%d%d",&a,&b);
c=a-b;
printf("\nThe result of subtraction is %d",c);
printf("Enter two numbers to multiply\n');
scanf("%d%d",&e,&f);
d=e*f;
printf("\nThe result of multiplication is %d",d);
printf("Enter two numbers to division\n');
scanf("%d%d",&e,&f);
c=a/b;
printf("\nThe result of division is %d",d);
getch();
}
output:
Enter two numbers to add
5 6
The result of addition is 11
Enter two numbers to sub
6 5
The result of subtraction is 1
Enter two numbers to multiply
6 5
The result of multiplication is 30
Enter two numbers to division
6 5
The result is 1
EXPLANATION:
THE ABOVE PROGRAM IS USED TO CALCULATE TWO NUMBERS WITH DIFFERENT OPERATIONS :
ADDITION.
SUBTRACTION.
MULTIPLICATION.
DIVISION.
No comments:
Post a Comment