double res = (double)((a*b)/(a+b));
After trying the above code with inputs 80,70 I am getting the output 37 not 37.333 but after removing one parenthesis i got the right answer.
The right code is:
double res = (double)(a*b)/(a+b);
I am using: gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)