#include <stdio.h>
int main ()
{
printf ("Give me three integers:\n");
int x1, x2, x3, a;char g;
scanf ("%d%d%d", &x1, &x2, &x3);
printf ("\nSelect one of the following letters to perform a logical operation:\n"); printf ("A\tLogical AND\nO\tLogical OR\n");
scanf ("%s", &g);
switch (g)
{ case 'A': { if (x1 && x2 && x3)
a = 1;
else
a = 0; printf ("%d\tAND\t%d\tAND\t%d\t=\t%d\n", x1, x2, x3, a);
break; }
case 'O':
{ if (x1 || x2 || x3)
a = 1;
else a = 0;
printf ("%d\tOR\t%d\tOR\t%d\t=\t%d\n", x1, x2, x3, a);
break; } }
return 0;
}