netjunky

Untitled

Sep 26th, 2010
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. main()
  4. {
  5.       double A,B,H,X,Y;
  6.       int i = 0;
  7.      
  8.   printf("Y=ln(sqrt(e^x-1)) tabuleerimine 1. meetodiga\n");
  9.   printf("A=");
  10.   scanf("%lf",&A);
  11.   printf("B=");
  12.   scanf("%lf",&B);
  13.   do { printf("H (H>0) =");
  14.        scanf("%lf",&H);
  15.      } while (H<=0);
  16.      
  17.   printf("  ARGUMENT  |  Funktsioon\n");
  18.   printf("__________________________\n");
  19.  
  20.  
  21.   /*X = A ;
  22.   Y =log(sqrt( exp(X-1)));
  23.  
  24.   while (X==B) {printf("%10.4lf  | %10.4lf ",X,Y);
  25.      if (X < B)
  26.      X = X + H;
  27.      else
  28.      X = X - H;
  29.      } */
  30.      
  31.      do {
  32.         if(i == 0) {
  33.             X = A;
  34.         } else if(i == 1) {
  35.             X = A + H;
  36.         } else {
  37.             X = A + H + i;
  38.         }
  39.        
  40.         Y = log( sqrt( exp( (double)(X - 1) ) ) );
  41.        
  42.         printf("%10.4lf  | %10.4lf  \n", X, Y);
  43.        
  44.         i++;
  45.     } while(Y <= (double)B);
  46.  
  47.      return 0;
  48.      }
Add Comment
Please, Sign In to add comment