#include<stdio.h> int main(void) { int i,n; double x,y; double cylinder(double x); printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ printf("Enter x : "); scanf("%lf",&x); if(x<=0) { printf("Enter wrong!"); } else{ y=cylinder(x); printf("y=%.3f ",y); } } return 0; } double cylinder(double x) { double y; if(x<=50){ y=0.53*x/3; } else{ y=0.58*x-2.5; } printf("y=f(%f)=%.2f ",y); return y; }