Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- float x,f(x);
- printf("digite x:");
- scanf("%f",&x);
- if(x<=1)
- printf("f(x) sera 1");
- else
- if(x>1 && x<=2)
- printf("f(x) sera 2");
- else
- if(x>2 && x<=3)
- f(x)=pow(x,2.0);
- printf("f(x) sera %f",f(x));
- else
- if(x>3)
- f(x)=pow(x,3.0);
- printf("f(x) sera %f\n",f(x));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment