I want to know what is the difference between these two statements in C. Are they same? Any logical proof whether they are same or not.
if (!(b[i]&&c[i+1]&&c[i+2]&&d[i+3]))
and:
if (((b[i] == 0|| c[i+1] == 0)|| c[i+2] == 0)|| d[i+3] == 0)
I want to know what is the difference between these two statements in C. Are they same? Any logical proof whether they are same or not.
if (!(b[i]&&c[i+1]&&c[i+2]&&d[i+3]))
and:
if (((b[i] == 0|| c[i+1] == 0)|| c[i+2] == 0)|| d[i+3] == 0)
是的,他们都会评估相同的结果。
如果其中任何一个值0
大于表达式将返回 true 并输入 if 语句(除了最后缺少的括号)
就证明而言,这或多或少是德摩根定律
他们是一样的!对于一些证据,您可以阅读有关德摩根定律的信息