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

find out largest elemant of diagonalmatrix

2269


Define and explain about ! Operator?

1009


Explain the red-black trees?

1143


What is the difference between typedef and #define?

1075


What does %p mean c?

1083


while initialization of array why we use a[][2] why not a[2][]...?

2377


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2276


Write a program to identify if a given binary tree is balanced or not.

1183


What is a static variable in c?

1141


What Is The Difference Between Null And Void Pointer?

1278


Where we use clrscr in c?

1152


Should I learn data structures in c or python?

1037


What are valid signatures for the Main function?

1251


hi, which software companys will take,if d candidate's % is jst 55%?

2101


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1734