ExplanationThe four binary bits for A and B are entered. The if statement checks the bits of A
and B. If one of them is at logic one then the output C must be 1. When the inputs are zero the output
is also 0.
6.50 Write a program to verify the truth table of EX-OR GATE.
# include <stdio.h>
# include <conio.h>
void mainO
{
int x,a[4] ,b [4] ,c [4] ;
clrscrO ;
printf ("Enter Four Bits
for (x=0;x<4;x++)
I
scanf ("%d",ha[x]);
if
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.