home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
datafiles
/
text
/
c_tutor
/
shifter.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
490b
|
24 lines
main()
{
int small, big, index, count;
printf(" shift left shift right\n\n");
small = 1;
big = 0x4000;
for(index = 0;index < 17;index++) {
printf("%8d %8x %8d %8x\n",small,small,big,big);
small = small << 1;
big = big >> 1;
}
printf("\n");
count = 2;
small = 1;
big = 0x4000;
for(index = 0;index < 9;index++) {
printf("%8d %8x %8d %8x\n",small,small,big,big);
small = small << count;
big = big >> count;
}
}