nikolas_serafini

Lista 3 - Exercício 66

Jun 17th, 2013
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int i,j = 0;
  7.     float numberVector[200],number;
  8.  
  9.     while (number != 0)
  10.     {
  11.         printf("Entre com um numero :\n");
  12.         scanf("%f",&number);
  13.         if (number == 0)
  14.         {
  15.             break;
  16.         }
  17.         else
  18.         {
  19.             numberVector[j] = number;
  20.             j++;
  21.         }
  22.        
  23.     }
  24.     printf("VALOR     QUADRADO     CUBO     RAIZ\n");
  25.     for (i = 0; i < j; i++)
  26.     {
  27.         printf("%f     %f     %f     %f\n",numberVector[i],pow(numberVector[i],2),pow(numberVector[i],3),pow(numberVector[i],0.5));
  28.         if (i % 20 == 0)
  29.         {
  30.             printf("VALOR     QUADRADO     CUBO     RAIZ\n");
  31.         }
  32.     }
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment