Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. double gamma, a = 8.9;
  7. double alpha;
  8. double dx = 6;
  9.  
  10. for (alpha = 35; alpha < 50; alpha += dx)
  11. gamma = a * pow (sin (alpha + M_PI/10), 2) / (log(a) - cos (alpha / 3));
  12.  
  13. printf ("for: %f", gamma);
  14.  
  15.  
  16. alpha = 35;
  17. while (alpha < 50)
  18. {
  19. gamma = a * pow (sin (alpha + M_PI/10), 2) / (log(a) - cos (alpha / 3));
  20. alpha += dx;
  21. }
  22.  
  23. printf ("\nwhile: %f", gamma);
  24.  
  25.  
  26. alpha = 35;
  27. do
  28. {
  29. gamma = a * pow (sin (alpha + M_PI/10), 2) / (log(a) - cos (alpha / 3));
  30. alpha += dx;
  31. } while (alpha < 50);
  32.  
  33. printf ("\ndo while: %f", gamma);
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement