Advertisement
evgenko

S_Mavr_lab7_ex2

Dec 14th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <tgmath.h>
  3.  
  4. int main() {
  5.     printf("Enter  xmin: ");
  6.     float xmin, h;
  7.     scanf("%f", &xmin);
  8.     printf("Etner the h: ");
  9.     scanf("%f",&h);
  10.     float x = xmin;
  11.     for (int i=0;i<10;i++,x+=h){
  12.         float a;
  13.         printf("Enter a: ");
  14.         scanf("%f",&a);
  15.         float y;
  16.         if (x+2>=5){
  17.             y = x+4;
  18.         }else{
  19.             if (a+fabs(x-2)<10){
  20.                 y = a/3 + x;
  21.             }else{
  22.                 y = x-a;
  23.             }
  24.         }
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement