fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. double x, y;
  5. printf("x: ");
  6. scanf("%lf", &x);
  7.  
  8. if (x > -21 && x <= 3){
  9. y = -14 * x - 20;
  10. printf("y = (-14 * x) - 20 for x = %lf, result: y = %lf\n", x, y);
  11.  
  12. } else if (x > 12){
  13. y = -14 * x - 20;
  14. printf("y = (-14 * x) - 20 for x = %lf, result: y = %lf\n", x, y);
  15.  
  16. } else if (x < -41){
  17. y = (13 * (x * x)) / 5; // Спрощення виразу
  18. printf("y = 13 * (x * x) / 5 for x = %lf, result: y = %lf\n", x, y);
  19.  
  20. } else {
  21. printf("x = %lf не потрапляє в жоден з визначених діапазонів\n", x);
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
x: y = (-14 * x) - 20 for x = 0.000000, result: y = -20.000000