   Programmer Exam Question
  I recently requested the programmer exam from Gearbox''s site. I''m missed this question and I''m wondering if somebody knows the answer.Here is the question.1. Rewrite the following function so that the following conditions are satisfied:A) the multiplication operator (''*'') is not used.B) the division operator (''/'') is not used.C) the function does not make use of loops.D) And no sneaky using assembly either!int MultiplyBy321(int value){int rslt;rslt = value * 321;return rslt;}  
  I''m thinking recursion because I failed at properly using shift operators.  ;  int MultBy321 ( int value ) {    return (value<<8) + (value<<6) + value;}  -Neophyte  ;http://www.gamedev.net/community/forums/topic.asp?topic_id=137766 --Simon O''ConnorCreative Asylum Ltdwww.creative-asylum.com;  int multiply321(int value){  return value<<8 + value<<6 + value;}  ;quote:Original post by snowball123  I''m thinking recursion because I failed at properly using shift operators. Then think again. It can be done easily with two bit shifts and two additions.;  Well there are probably a number of solutions to the problem.  Bitshifting might be the way to go, but seeing as how you can''t use loops, the multiplication/division operators, or asm it would appear as if they want you to write a recursive function. Which is probably where you''ll find your solution.;  int MultiplyBy321(int value){int rslt;//rslt = value * 321;rslt = (value << 8) +  (value << 6) + value;return rslt;}  ;  Wow, very impressive everybody!  ;  A few small questions!1.) How long did this problem take you to solve?2.) Difficulty (Easy, Medium, Hard)?3.) How did you approach this problem?  