Computer Science, asked by karmapramit97, 1 year ago

write a programs to print the calculator using c

Answers

Answered by sid2649
0
#include<stdio.h>
main()
{
int i, j, k;
char ope;
printf("1st no");
scanf("%d", &i);
printf("2nd one");
scanf("%d", &j);
printf("Operator: + | - | / | * \n");
scanf(" %c", &ope);

 if(ope == ' + ')
 {
 cal= i + j;
 printf("Addition of two numbers is: %d",cal);
 }
else if(ope == ' - ')
 {
 cal= num1 - num2;
 printf("Subtraction of two numbers is: %i",k);
 }
else if(ope == ' / ')
 {
 cal= num1 / num2;
 printf("Division: %d",k);
 }
else if(ope == ' *' )
 {
 cal= i * j;
 printf("Multiplication: %d",k);
 }
else
 {
 printf("Invalid Input"); 
 }
}

sid2649: btw placement session start ho gaya aap logo ka?
karmapramit97: i know bt
karmapramit97: my fds uses
karmapramit97: some others perpose
karmapramit97: ya bhut sari company aati hai
sid2649: good
sid2649: all the best for ur placements!
karmapramit97: aur kuchh
karmapramit97: thanks bhai
karmapramit97: bye...
Similar questions