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 is a null string in c?
What is use of integral promotions in c?
What are conditional operators in C?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
What is the function of multilevel pointer in c?
Tell us bitwise shift operators?
What is sorting in c plus plus?
Where are the auto variables stored?
Can true be a variable name in c?
Explain what are multidimensional arrays?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
Why is c still so popular?
Can a program have two main functions?
Dont ansi function prototypes render lint obsolete?
What is difference between Structure and Unions?