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

What are the two types of functions in c?

0 Answers  


What would be an example of a structure analogous to structure c?

0 Answers  


what is the different bitween abap and abap-hr?

0 Answers   TCS,


what is diognisis?

1 Answers  


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

0 Answers  


can we execute the program with the object file

1 Answers  


Explain what is the purpose of "extern" keyword in a function declaration?

0 Answers  


Write a program to show the change in position of a cursor using c

0 Answers  


How can I change the size of the dynamically allocated array?

0 Answers  


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

0 Answers  


how to find out the inorder successor of a node in a tree??

2 Answers   TCS, Yahoo,


How do you print an address?

0 Answers   TCS,


Categories