The equivalence of Boolean expressions (De Morgan's Laws):

!(x && y) = (!x || !y)
!(x || y) = (!x && !y)
#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;

int main()
{
    int x, y;

    cout << endl << "x y   !(x && y)   !x || !y    !(x || y)   !x && !y ";
    cout << endl << "---   ---------   ---------   ---------   ---------";
    cout << endl;
	
    for (x = 0; x < 2; x++)
    {
        for (y = 0; y < 2; y++)
        {
            cout << x << " " << y 
            << setw(8) << !(x && y) << setw(12) << (!x || !y) 
            << setw(12) << !(x || y) << setw(12) << (!x && !y) << endl;
        }
    }
    cout << endl;
  
    return 0;
}

Output:

x y   !(x && y)   !x || !y    !(x || y)   !x && !y
---   ---------   ---------   ---------   ---------
0 0       1           1           1           1
0 1       1           1           0           0
1 0       1           1           0           0
1 1       0           0           0           0