what is the purpose of the code, and is there any problem
with the code?
int f( int n, int l, int r )
{ return (n << l) >> r; }
Answer Posted / senthil
f returns (n * 2^(l-r))
n<<l => n * 2^l
(n<<l)>>r => (n * 2^l)/(2^r)=>(n * 2^(l-r))
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the complete rules for header file searching?
What is the difference between array and pointer?
I have a varargs function which accepts a float parameter?
What does 3 mean in texting?
Is it possible to have a function as a parameter in another function?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
Is there a built-in function in C that can be used for sorting data?
What is clrscr ()?
Write a program to print numbers from 1 to 100 without using loop in c?
What is a lookup table in c?
What is calloc malloc realloc in c?
What does sizeof int return?
What is function prototype in c with example?
What is pointers in c with example?