That will always give the answer: a. You can try it.
1 2 3 4 5 6
#include <iostream>
int main()
{
double a = 4.0, r1 = 5.0;
std::cout << a / (r1 / r1 + a * r1 - a * r1);
}
* and / take priority ("precedence") over + and -, so (within a bracket) they will be done first.
Brackets will also be completed before anything else.
You can find the complete order of precedence at https://en.cppreference.com/w/cpp/language/operator_precedence
You only need items 5 and 6 in that list. For numerical operations, the order of calculation is the same as standard arithmetic. You don't need the internet for that.
Roughly:
a / (r1 / r1 + a * r1 - a * r1) -> a / ( 1 + value - value ) -> a / 1 -> a
dialgpalkia wrote:
From my understanding of logic
Your understanding of logic is wrong. You are (incorrectly) doing + and - before * and /.