大家帮忙看下这个简单的问题怎么结果不对呢?麻烦下,谢谢!
#include<stdio.h>main()
{
float a,b;
char c;
printf("input here:");
scanf("%d%d",&a,&b);
printf("select(+,-,*,/)");
scanf("%c",&c);
scanf("%c",&c);
if (c=='-')
printf("a-b=%f-%f=%f",a,b,a-b);
else if(c=='+')
printf("a+b=%f+%f=%f",a,b,a+b);
else if(c=='*')
printf("a*b=%f*%f=%f",a,b,a*b);
else if(c=='/')
printf("a/b=%f/%f=%f",a,b,a/b);
}