#include
#include
int func( int x );
int main( int argc, char *argv[] )
{
int x, y;
printf("Please input an integer : ");
scanf("%d", &x);
y = func( x );
printf("The result of call the func function %d\n", y);
return 0;
}
int func( int x )
{
if( x < 1)
{
return x;
}
else if( x >= 10 )
{
return (3*x-1);
}
else
{
return (2*x-1);
}
}
#include
void main()
{
float x,y;
scanf("%f",&x);
if(x<1) y=x;
else if(x<10) y=2*x-1;
else y=3*x-1;
printf("%f",y);
}
#include