Operators and Expressions 59
After execution
c=12
0 0 0 0 0 0 0 0 Q 0 0 0 1 1 0 0
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 0
Table 3.7 Table of exclusive OR
INPUTS
OUTPUT
X Y
z !
0
0 0
0
1
i
1
0
i
1
1 0
3.21 Write a program with Exclusive OR operation between the two integers and display the
result.
m ain()
{
in t a,b,c;
c l r s c r ( ) ;p r i n tf ( nRead The In te g e r s from keyboard (a & b) j -");
scanf ("%d %d", &a,&b);
c=a^b;
printf ("The data after Exclusive OR operation is in c= %d",c);
getcheO;
I
OUTPUT:
Read The Integers from keyboard (a & b) : 8 2
The data after Exclusive OR operation is in c =10
Before execution
as 8
0 0 0 0
0
0 0 0 0
0
0
0 1
0 0 0
15 14 13 12
Before execution
11 10
09 08
07 06 05
04 03
02 01 0
b=2
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.221.144