想做个简单的计算器程序,不知道怎么样才能printf这句话显示出C的值
# include <stdio.h>int main (void)
{
int a;
int c;
int b;
int i;
scanf("%d\n", &a);
for(i=0; i<++i+1; ++i)
{ char ch;
ch = getchar();
switch(ch)
{
case'+':
scanf("%d", &b);
c=a + b;
break;
case'-':
scanf("%d", &b);
c=a - b;
break;
case'*':
scanf("%d", &b);
c=a * b;
break;
case'/':
scanf("%d", &b);
c=a / b;
break;
}
a = c;
}
printf("%d\n", c);
return 0;
}