/*C program to design simple calculator in C.*/
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a,b, sum, sub, mul, div;
printf("Enter first number ");
scanf("%d",&a);
printf("Enter second number ");
scanf("%d",&b);
sum=a+b;
sub=a-b;
mul=a*b;
div=a/b;
printf("Sum of a and b is=%d", sum);
printf("Subtraction of a and b is=%d", sub);
printf("Multiplication of a and b is=%d", mul);
printf("Division of a and b is=%d", div);
getch();
}
Expected Output:-
Enter first number
15
Enter second number
5
Sum of a and b is=20
Subtraction of a and b is=10
Multiplication of a and b is=75
Division of a and b is=3
C program to design simple calculator in C. |