let’s say its given that there are 4 numbers n, a, b, c. n being the total amount of money required for an action, a being the money held by person 1, b being the money held by person 2 and c being the money held by person 3. It is given that the amount money required has to be contributed by 2 people only no more no less then in C++ why can’t we execute the OR command as following:
if((a+b) || (b+c) || (a+c) >= n){
printf("YESn");
I expected the command to compare all the OR statements against the given amount of n but it somehow exits without comparing all the values and prints YES every time even if the answer should be NO.
user19978719 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.