Advertisement
Makakas

TABULATION F(X)=2TAN(X/2)+1 WHILE

Mar 14th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <conio.h>
  4. int main ()
  5. {
  6. float a,b,f,x;
  7. int m,n;
  8. {
  9. printf("Set the interval [a,b] \n");
  10. scanf("%f %f",&a,&b);
  11. printf("Enter step \n");
  12. scanf(" %d",&m);
  13. x=a;
  14. n=1;
  15. printf(" Function f(x)=2tg(x/2)+1 \n");
  16. printf("------------------------------------------------\n");
  17. printf("| n | x | f(x) |\n");
  18. while(x<=b)
  19. {
  20. f=2*tan(x/2)+1;
  21. printf("| %5d | %5.2f | %5.2f |\n",n,x,f);
  22. x=x+m;
  23. n=n+1;
  24. }
  25. printf("------------------------------------------------\n");
  26. printf("\n");
  27. printf(" \n");
  28. scanf(" ");
  29. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement