Morgan Stanley Interview Question

how do you write "2008" at the console using any language without any ?number in your code

Interview Answers

Anonymous

May 12, 2014

We know that C language can work in case of ASCII values so we can use techniques like ASCII values of C-A that will give 2 in numeral,similarly for 0 0 8 also

2

Anonymous

Oct 2, 2014

Console.WriteLine(('c' - 'a').ToString() + ('a' - 'a').ToString() + ('a' - 'a').ToString() + ('i' - 'a').ToString());

1

Anonymous

Jul 15, 2014

var today = new Date(); var year = today.getFullYear(); var days = ['sun','mon','tue','wed','thu','fri']; var len = days.length; console.log(year - len);

1