C语言编写的计算器?帮我看看为什么乘法和除法不输出,加法减法能输出。新手新手新手求
#include"stdio.h"int add(int b ,int c);
int jianfa(int b,int c);
int chenfa(int b ,int c);
int chufa(int b,int c);
void menu();
main()
{int a,b,c,d;
while(1)
{
menu();
scanf("%d",&a);
switch(a)
{ case 1:
scanf("%d%d",&b,&c);
d=add(b,c);
printf("%d",d);break;
case 2:
scanf("%d%d",&b,&c);
d=jianfa(b,c);
printf("%d",d);break;
case 3:
scanf("%d%d",&b,&c);break;
d=chenfa(b,c);
printf("%d*%d=%d",b,c,d);break;
case 4:
scanf("%d%d",&b,&c);break;
d=chufa(b,c);
printf("%d",d);break;
}
}
}
void menu()
{
printf(" +++++=1.加法=+++++++++\n");
printf(" +++++=2.减法=+++++++++\n");
printf(" +++++=3.乘法=+++++++++\n");
printf(" +++++=4.除法=+++++++++\n");
}
add(int b,int c)
{ int sum;
sum=b+c;
return sum;
}
jianfa(int b,int c)
{ int sum;
sum=b-c;
return sum;
}
chenfa(int b,int c)
{ int sum;
sum= (b * c) ;
return sum;
}
chufa(int b,int c)
{int sum;
sum=(b/c);
return sum;
}