Загрузка...

Need to solve a problem

Thread in C/C++ created by lolisc Apr 17, 2021. 195 views

  1. lolisc
    lolisc Topic starter Apr 17, 2021 7 Jul 12, 2019
    давно уравнение y=2x^2-5x-8
    ограничения от -2 до 2
    шаг 0,5
    сделать с помощью while
     
  2. hwpo
  3. ReverseFlash
    C
    #include <iostream>
    using namespace std;
    int main()
    {
    setlocale(LC_ALL, "Russian");
    float x = -2;
    cout << "Y = 2x^2-5x-8" << endl;
    while (x < 2.5)
    {
    cout << "---------" << endl;
    cout << "X = " << x << endl;
    cout << "Y = " << 2 * x * 2 * x - 5 * x - 8 << endl;
    cout << "---------" << endl;
    x += 0.5;
    }
    return 0;
    }
    The post was merged to previous Apr 17, 2021
    ошибся, там 2*x*x-5*x-8
     
Top
Loading...