#include "stdafx.h" #include <iostream> #include <math.h> #include <conio.h> #include <iomanip> using namespace std; int main(void) { setlocale(0, "Russian"); double expr1, expr2, func, pi = 3.14; expr1 =pow(cos(fabs(sin(2 / pi))),4) / pow((1 + log(10)), 1 / 3) + pow(1.01, 10)*exp(cos(pow(2, 1 / 5)) + pow(7, 1 / 7)); expr2 = log2(pi) + exp(pi) / sqrt(1 + pow(3, 1 / 3)) + asin(1 / 3); if (fabs(expr2)) + (fabs(expr1) >= 10); { func = log2(fabs(1 + expr2 + expr1) + 5 * pow(expr1, 1 / 3)); } else { func = sin((pow(expr2, 2)) + pow(expr1, 2)) + pow(expr2, 10); } cout << "func=" << func << endl; _getch(); return 0; } 
  • one
    Doesn't Visual Studio really provide the backlight for paired brackets? - αλεχολυτ

2 answers 2

You're confused in brackets and in semicolons:

 if (fabs(expr2) + (fabs(expr1) >= 10)) 

    I’ll add @Vladimir to the answer that this is not your only mistake. In expressions like 1/3, 1/5 - you use integer constants, and therefore the results of the expression themselves will be integer. Do not be surprised later that pow(2,1/5) will produce 1 ... Use floating point literals - such as pow(2,1.0/5.0) ...