hello guys i am trying to convert my 1 into 't' and my 0 into 'f' but so far no luck. Any help will be appreciated. It is a basic truth table. Thank you. Here is the code
#include <string>
using namespace std;
int main()
{
int a,b,c,d,e,f,g,h,i,j,k,l,m;
#include <iostream>
#include <iomanip>
#include <string>
usingnamespace std;
int main()
{
constint width = 10;
#define W << setw( width ) <<
char T[] = { 'F', 'T' };
cout W "A" W "B" W "!A" W "!B" W "A&&B" W "A||B" W "A^B" W "!(A&&B)" W "!A||!B" W "!(A||B)" W "!A&&!B" << endl;
cout << string( 11 * width, '-' ) << endl;
for ( int i = 3; i >= 0; i-- )
{
bool A = i & 2, B = i & 1;
cout W T[A] W T[B] W T[!A] W T[!B] W T[A&&B] W T[A||B] W T[A!=B] W T[!(A&&B)] W T[!A||!B] W T[!(A||B)] W T[!A&&!B] << endl;
}
}
A B !A !B A&&B A||B A^B !(A&&B) !A||!B !(A||B) !A&&!B
--------------------------------------------------------------------------------------------------------------
T T F F T T F F F F F
T F F T F T T T T F F
F T T F F T T T T F F
F F T T F F F T T T T