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 __date__ and __time__ preprocessor commands?
Explain about the constants which help in debugging?
What are integer variable, floating-point variable and character variable?
Why c is known as a mother language?
a program that can input number of records and can view it again the record
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
How can I make sure that my program is the only one accessing a file?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What are the functions to open and close the file in c language?
What is register variable in c language?
explain what is a newline escape sequence?
How is actual parameter different from the formal parameter?
What is function definition in c?