!(A || B) == (!A && !B)
!(A && B) == (!A || !B)
Where A
and B
represent either a 0
or 1
.
Assume the function f()
is defined as
int f()
{
return(1 && (30 % 10 >= 0) && (30 % 10 <= 3));
}
Applying DeMorgan's Theorem to the function f()
means all these conditional statements will return true or 1 in the C programming language.
!f() == !(1 && (30 % 10 >= 0) && (30 % 10 <= 3))
!!f() == (!1 && !(30 % 10 >= 0) && !(30 % 10 <= 3))
f() == 0 || (30 % 10 < 0) || (30 % 10 > 3)