Advertisement
Jorge_Lugo97

Valores de coseno

Nov 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #define PI 3.141593
  4.  
  5. int main (){
  6.     float arreglo1[9]={0,PI*(1.0/4.0), PI*(1.0/2.0),PI*(3.0/4.0), PI, PI*(5.0/4.0), PI*(3.0/2.0), PI*(7.0/4.0),PI*(2.0)};
  7.     float arreglo2[9];
  8.    
  9.     for (int i=0; i<9; i++)
  10.         arreglo2[i]=cos(arreglo1[i]);
  11.             for (int i=0; i<3; i++)
  12.                 printf("\n\t cos(%f) = %.4f\n",arreglo1[i+2],arreglo2[i+2]);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement