SHARE
TWEET

Untitled

a guest Jan 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <conio.h>
  4.  
  5.  
  6. int main(void)
  7. {  
  8.    float y[15];
  9.    int n;
  10.    int x[15];
  11.    int Ym;
  12.    int a;
  13.    int H ;
  14.     printf("Sisesta piirv22rtus YM:");
  15.     scanf("%d", &Ym);
  16.     printf("Sisesta samm H:");
  17.     scanf("%d", &H);
  18.     printf("Sisesta x alamv22rtus a:");
  19.     scanf("%d", &a);
  20. int i=0;
  21. x[0]=a;
  22.            do
  23.              {      
  24.                   x[i]=x[0]+(i*H);
  25.                    y[i] = (1/x[i]); // Mingil põhjusel 1/x[i] ei arvuta välja
  26.                      i++;
  27.                      n=i;}
  28.        while (i<15 && y[i-1]<=Ym);  
  29.        printf("x    |    y\n");
  30.        for(i=0;i<=n-1;i++)
  31. {
  32.        printf("%d   |   %f\n",  x[i], y[i]);
  33.        }
  34.      getch();
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top