Saturday, February 1, 2020

Basic Calculator

#include<stdio.h>
#include<conio.h>
int main()
{
 int a, b, c, d, e, f;

 printf("Enter your number1:");
 scanf("%d",&a);

 printf("Enter your number2:");
 scanf("%d",&b);

c=a+b;
d=a-b;
e=a*b;
f=a/b;

 printf("Add: %d=%d+%d \n", c,a,b);
 printf("Sub: %d=%d-%d \n", d,a,b);
 printf("Multiply: %d=%dx%d \n", e,a,b);
 printf("Divide: %d=%d/%d \n", f,a,b);
getch();
}

1 comment: