Morgan Stanley

www.morganstanley.com
Employer Engaged

Interview Question

Technology Associate Interview

if you are asked to build a simple calculator, what do you

  plan to do? example input - "1+2*3/(5-4)-6 " output - "1" (coded solution is preferred).
Tags:
java, c++, algorithm, code
Answer

Interview Answer

1 Answer

0

str="1+2*3/(5-4)-6 ";
i=eval(str);
printf("%d",i);

MiKL~ on Feb 29, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.