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;
- 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) {
- return 0; }
- if (X<B) {
- if (i==1) {
- X=A+H; }
- if (i>1) {
- X=A+i*H; }
- if (X>=B) {
- return 0; }
- }
- }
- Y=log( sqrt( exp( (double)(X-1))));
- if (exp(X-1)<0)
- printf("Puudub");
- else
- printf("%10.4lf |%10.4lf ",X,Y);
- i++;
- } while(1);
- return 0;
- }
Add Comment
Please, Sign In to add comment