View Code of Problem 69

#include<stdio.h>
#include<math.h>
int f1(int a)
{
	int p;
	p=2*a-1;
	return(p);
}

int f2(int b)
{
	int q;
	q=3*b-11;
	return(q);
}
int main()
{
	int x,y;
	scanf("%d",&x);
	if(x<1)
		y=x;
	else if(x>=1&&x<10)
		y=f1(x);
	else
		y=f2(x);
	printf("%d\n",y);
	return 0;

}

Double click to view unformatted code.


Back to problem 69