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; }

Answers were Sorted based on User's Feedback



what is the purpose of the code, and is there any problem with the code? int f( int n, int l, i..

Answer / 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

what is the purpose of the code, and is there any problem with the code? int f( int n, int l, i..

Answer / guest

first it will call to n and then it will move on l or r, if
it is less then or equal to is there so it will return the
value ..... or else it will print the output

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

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

0 Answers  


WHAT IS MEANT BY LIFE?

2 Answers  


what is the difference between i++ and ++i?

5 Answers  


main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }

6 Answers  


What is far pointer in c?

0 Answers  


what is array?

8 Answers  


how to devloped c lenguege?

4 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

4 Answers  


What are the 5 types of inheritance in c ++?

0 Answers  


write a program to generate 1st n fibonacci prime number

12 Answers  


if the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one of the item

2 Answers  


Explain demand paging.

1 Answers   Agilent,


Categories