Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- main()
- {
- double A,B,H,X,Y;
- int i = 0;
- printf("Y=ln(sqrt(e^x-1)) tabuleerimine 1. meetodiga\n");
- printf("A=");
- scanf("%lf",&A);
- printf("B=");
- scanf("%lf",&B);
- do { printf("H (H>0) =");
- scanf("%lf",&H);
- } while (H<=0);
- printf(" ARGUMENT | Funktsioon\n");
- printf("__________________________\n");
- /*X = A ;
- Y =log(sqrt( exp(X-1)));
- while (X==B) {printf("%10.4lf | %10.4lf ",X,Y);
- if (X < B)
- X = X + H;
- else
- X = X - H;
- } */
- do {
- if(i == 0) {
- X = A;
- } else if(i == 1) {
- X = A + H;
- } else {
- X = A + H + i;
- }
- Y = log( sqrt( exp( (double)(X - 1) ) ) );
- printf("%10.4lf | %10.4lf \n", X, Y);
- i++;
- } while(Y <= (double)B);
- return 0;
- }
Add Comment
Please, Sign In to add comment