Search code examples
logiclogical-operatorsboolean-logicboolean-expression

What is the difference between the logic of these 2 codes?


I have 2 lines of code. Their logic looks the same to me but I am experiencing some bugs which seem to suggest I am wrong.

Code 1;

A and B and C
OR (AA and BB) and CC
OR (AAA and BBB) and CCC
or (AAAA and BBBB) and CCCC

Code 2:

(A and B and C)
OR (AA and BB and CC)
OR (AAA and BBB and CCC)
or (AAAA and BBBB and CCCC)

Am I right that both codes are logically equivalent? I fail to see any difference.


Solution

  • I will answer my own question.

    Both codes are logically equivalent. No difference.