#include
void main()
{double x,y;
printf("Enter a number:");
scanf("%lf",&x);
if(x<0)
{y=x;}
else if(x>=0&&x<10)
{y=3*x-1;}
else if(x>=10)
{y=2*x*x-11;}
printf("f(%lf)=%lf\n",x,y);
}
#include
float f(float x)
{
int y;
if(x<0)
{
y=x;
}
else if(x>=10)
{
y=2*x*x-11;
}
else
{
y=3*x-1;
}
return y;
}
int main()
{
float x;
scanf("%f",&x);
printf("f(x)=%0.2f",f(x));
}