Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the __date__ and __time__ preprocessor commands?

1062


Explain about the constants which help in debugging?

1328


What are integer variable, floating-point variable and character variable?

1201


Why c is known as a mother language?

1050


a program that can input number of records and can view it again the record

1875


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1137


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)

6769


How can I make sure that my program is the only one accessing a file?

1215


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3305


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5910


What are the functions to open and close the file in c language?

1006


What is register variable in c language?

998


explain what is a newline escape sequence?

1049


How is actual parameter different from the formal parameter?

987


What is function definition in c?

1038