CopyBits(x,p,n,y)
copy n LSBs from y to x starting LSB at 'p'th position.
Answer Posted / rakesh
It should be p--, not p++. for example y = 217 (11011001)
and you want to extract the least 4 SB then n = 4 and p = 3
(remember the number start from 0 to 7 in memory). After
executing this you will get x = 9 i.e 1001.
t=0;
for(i=n; i>0; i--)
{
t |= (1<<p);
p--;
}
x=x&~t;
t=t&y;
x=x|t;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a static function in c?
How can you call a function, given its name as a string?
What are the different types of linkage exist in c?
Describe how arrays can be passed to a user defined function
What is the sizeof () operator?
Can you define which header file to include at compile time?
What is a protocol in c?
What is identifiers in c with examples?
ATM machine and railway reservation class/object diagram
Explain how do you search data in a data file using random access method?
Is c is a middle level language?
How can you invoke another program from within a C program?
What is use of pointer?
What is clrscr in c?
How to implement a packet in C