View Code of Problem 69

#include<stdio.h>
int fun(int x)
{
    int y;
    if(x<1)
    {
        y=x;
        
    }
    if(1<=x&&x<10)
    {
        y=x*2-1;
        
    }
    if(x>=10)
    {
        y=3*x-11;
    }
    return y;
}
int main()
{
    int x,res;
    scanf("%d",&x);
    res=fun(x);
    printf("%d",res);
    return 0;
}

Double click to view unformatted code.


Back to problem 69