Reginaldojs

exercicio 51,lista 2

May 16th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.         float x,f(x);
  4.         printf("digite x:");
  5.         scanf("%f",&x);
  6.         if(x<=1)
  7.           printf("f(x) sera 1");
  8.         else
  9.           if(x>1 && x<=2)
  10.              printf("f(x) sera 2");
  11.           else
  12.             if(x>2 && x<=3)
  13.             f(x)=pow(x,2.0);
  14.             printf("f(x) sera %f",f(x));
  15.             else
  16.               if(x>3)
  17.               f(x)=pow(x,3.0);
  18.               printf("f(x) sera %f\n",f(x));
  19.         return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment