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 derived datatype in c?
How do you determine whether to use a stream function or a low-level function?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is pre-emptive data structure and explain it with example?
What type of function is main ()?
What is the difference between fread and fwrite function?
Why do we use int main?
How does free() know explain how much memory to release?
Write a program for Overriding.
What is the process of writing the null pointer?
What is malloc return c?
What is non linear data structure in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
How many types of functions are there in c?