Answer:
Input example:
select the funcion: 1
write the 1sd number2
write the 2nd number1
value is 2.000000
Step-by-step explanation:
#include <stdio.h>
main()
{
//define the variables as float
float a, b, c, e;
char d;
while (1)
{
//input values
printf("select the function: ");
scanf("%c",&d);
printf("write the 1sd number");
scanf("%f",&a);
getchar();
printf("write the 2nd number");
scanf("%f",&b);
getchar();
if (d=='%')
{
a=a*b/100;
}
if (d=='*')
{
a=a*b;
}
if (d=='+')
{
a=a+b;
}
if (d=='/')
{
a=a/b;
}
if (d=='-')
{
a=a-b;
}
printf("value is %f \\",a);
}
printf("final value is %f",a);
getchar();
}