Advertisement
allocator

Untitled

Nov 3rd, 2014
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     float a, b, c, xnach, xkon, dx;
  6.     printf("Vvedite a,b,c,xnach,xkon,dx: ");
  7.     scanf_s("%f %f %f %f %f %f", &a, &b, &c, &xnach, &xkon, &dx);
  8.    
  9.     float x = xnach;
  10.     while ((xnach <= x) && (x <= xkon)) {
  11.         float F;
  12.         if ((x - 1 < 0) && (b - x != 0))
  13.             F = a * x * x + b;
  14.         else if ((x - 1 > 0) && (b=-x))
  15.             F = (x - a) / x;
  16.         else
  17.             F = x / c;
  18.         printf("%f ",F);
  19.         x += dx;
  20.     }
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement