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