#include <iostream.h>
#include <iomanip.h>
int main()
{
    bool A=0, B=1, Z; //Wertevorrat ist nur 1 und 0
    //AND
    Z = A && B;
    cout << "\nA AND B = " << Z; 
    //OR
    Z = A || B;
    cout << "\nA OR B = " << Z; 
    //NOT
    Z = !A ;
    cout << "\nnicht A = " << Z;
    //
    Z = !A && B; // man kann auch nur ein & verwenden
    cout << "\nnicht A AND B = " << Z << endl;  
    //NAND Tabelle
    int a, b;
    cout << " B   A | Z \n"
         << "-----------\n";
    for(b=0; b<=1;b++)
    {
             B = b;
            for(a=0; a<=1;a++)
            {
                     A = a;
                     Z = !(A and B);
                     cout << " "    << B
                          << "   " << A
                          << " | "  << Z << endl;
            }
     }
                     
cout << "\nProgrammende...";
cin.get (); cin.get();
return(0);    
    }

/*

*/
