Advertisement
Makakas

FOR f(x)=2tg(1/x)+1

Mar 25th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <conio.h>
  5. int main()
  6. {
  7. float a, b, f, x;
  8. int m, n,i;
  9. {
  10. setlocale(LC_ALL, "RUSSIAN");
  11. printf("Функция [a,b] \n");
  12. scanf_s("%f %f", &a, &b);
  13. printf("Enter step \n");
  14. scanf_s(" %d", &m);
  15. x = a;
  16. n = 1;
  17. printf(" Function f(x)=2tg(x/2)+1 \n");
  18. printf("------------------------------------------------\n");
  19. printf("| n | x | f(x) |\n");
  20. for(i=0;i<b;i++)
  21. {
  22. f = 2 * tan(x / 2) + 1;
  23. printf("| %5d | %5.2f | %5.2f |\n", n, x, f);
  24. x = x + m;
  25. n = n + 1;
  26. }
  27. printf("------------------------------------------------\n");
  28. printf("\n");
  29. printf(" \n");
  30. scanf_s(" ");
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement