write a programs to print the calculator using c
Answers
Answered by
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");
}
}
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?
Similar questions