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 complete rules for header file searching?

1093


What is the difference between array and pointer?

1036


I have a varargs function which accepts a float parameter?

1058


What does 3 mean in texting?

1111


Is it possible to have a function as a parameter in another function?

1085


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

3073


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

1132


Is there a built-in function in C that can be used for sorting data?

1272


What is clrscr ()?

1113


Write a program to print numbers from 1 to 100 without using loop in c?

1089


What is a lookup table in c?

1124


What is calloc malloc realloc in c?

1065


What does sizeof int return?

1086


What is function prototype in c with example?

1096


What is pointers in c with example?

1087