if conditional 2 out of 3
4 vues (au cours des 30 derniers jours)
Zeynab Mousavikhamene le 11 Mai 2020
I have three groups of number which can be 0 or 1. like A, B and C. I want to write a conditional to be true if 2 of three values were 1. How can I do that?
The simplest way would be like:
if (A==1 && B==1) or (A==1 && C==1) or (B==1 && c==1)
but I am searching for sth shorter.