Calculator program in c using functions

Here we will discuss about how to make calculator using C Program. In this topic, we will discuss how we write a calculator program in the C programming language.

Wap to write a program in c to make calculator by using function.

calculator program in c using functions

Calculator program in c using functions

int sum(int,int);
int product(int,int);
int subtract(int,int);
void main()
int a,b,result=0;
char op;
printf("Enter 1st number, operator and 2nd number ");
scanf("%d %c %d",&a,&op,&b);
if (op=='+')
printf("sum = %d",result);
if (op=='*')
printf("product = %d",result);
if (op=='-')
printf("subtraction = %d ",result);
int sum(int a,int b)
{return a+b;
int product(int a,int b)
return a*b;
int subtract(int a,int b)
return a-b;

Post a Comment

Previous Post Next Post