Information Technology Reference
In-Depth Information
00000001
00000010
00000100
00001000
: :
10000000
00000001
00000010
and so on.
Hint : Use a do while loop with either the shift left operators ( << ) or output the
values 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, and so on.
16.6.9
Write separate programs which output the patterns in (a) and (b). The sequences
are as follows:
(a) 00000001 (b) 10000001
00000010 01000010
00000100 00100100
00001000 00011000
00010000 00100100
00100000 01000010
01000000 10000001
10000000 01000010
01000000 00100100
00100000 00011000
00010000 00100100
and so on.
: :
00000001
00000010
and so on.
16.6.10
Write separate programs which output the following sequences:
(a) 1010 1010
(b) 1111 1111
0101 0101 0000 0000
1010 1010 1111 1111
0101 0101 0000 0000
and so on.
and so on.
(c) 0000 0001
(d)
0000 0001
0000 0011 0000 0011
0000 1111 0000 0111
0001 1111 0000 1111
0011 1111 0001 1111
0111 1111 0011 1111
1111 1111 0111 1111
0000 0001 1111 1111
0000 0011 0111 1111
0000 0111 0011 1111
0000 1111 0001 1111
0001 1111 0000 1111
and so on.
and so on.
(e)
The inverse of (d) above.
Search WWH ::




Custom Search