View Code of Problem 69

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

Double click to view unformatted code.


Back to problem 69