Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<math.h>
- #include<windows.h>
- int main ()
- {
- double x, x1, dx, y;
- int K,S;
- system("cls");
- printf("Vvudute nuznuy granizhy x0=");
- scanf("%lf", &x);
- printf("Vvedite nuznuy granuzhy x1=");
- scanf("%lf", &x1);
- if(x>x1)
- return 0;
- printf("Vvedite wag dx=");
- scanf("%lf", &dx);
- printf("Vvedite vivod");
- scanf("%d", &S);
- if(dx<=0)
- return 0;
- K=0;
- printf("+--------------+----------------+\n");
- printf("| znachenie x | znechenie f(x) |\n");
- printf("+--------------+----------------+\n");
- while(x<x1)
- {
- if(x<-3)
- y=2*cos(x*x+1);
- else if(x<=2.4)
- y=sin(x-3);
- else
- y=1/x;
- K++;
- if(K>S)
- {
- system("pause");
- system("cls");
- K=1;
- printf("+-------------+----------------+\n");
- printf("| znachenie x | znechenie f(x) |\n");
- printf("+-------------+----------------+\n");
- }
- printf("| f(%10.3lf) | =%10.3lf |\n", x, y);
- x+=dx;
- }
- printf("Press any key to exit...");
- system("pause");
- }
Add Comment
Please, Sign In to add comment