Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double x;
- // int a, b, c;
- void input() {
- cout << "Enter x: ";
- cin >> x;
- // cout << "Enter a: ";
- // cin >> a;
- // cout << "Enter b: ";
- // cin >> b;
- // cout << "Enter c: ";
- // cin >> c;
- }
- double function(const double x) {
- return (x + 1) - ((3 * x * x + 4) / x);
- }
- int main() {
- input();
- // while (b < a) {
- // cout << "Input range again:\n";
- // input();
- // }
- if (x == 0) {
- cout << "\033[1;31mWhen x = 0 there is no solution\033[0m\n" << endl;
- } else {
- cout << "Result = " << function(x);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement