#include <stdio.h>
int main()
{
float a=0,b=0,z;
char m;
printf("a= ,b=\n");
scanf("%f %f",&a,&b);
printf("[Calculator + - * /]:");
getchar();
scanf("%c",&m);
switch(m)
{
case'+':
z=a+b;
printf("a+b=%.1f\n",z);
break;
case'-':
z=a-b;
printf("a-b=%.1f\n",z);
break;
case'*':
z=a*b;
printf("a*b=%.1f\n",z);
break;
case'/':
z=a/b;
printf("a/b=%.1f\n",z);
break;
default:
break;
}
return 0;
}
int main()
{
float a=0,b=0,z;
char m;
printf("a= ,b=\n");
scanf("%f %f",&a,&b);
printf("[Calculator + - * /]:");
getchar();
scanf("%c",&m);
switch(m)
{
case'+':
z=a+b;
printf("a+b=%.1f\n",z);
break;
case'-':
z=a-b;
printf("a-b=%.1f\n",z);
break;
case'*':
z=a*b;
printf("a*b=%.1f\n",z);
break;
case'/':
z=a/b;
printf("a/b=%.1f\n",z);
break;
default:
break;
}
return 0;
}