Logical Ability Test Question

Posted by Shantanupatel under Interview Questions on 2/6/2012 | Points: 10 | Views : 5823 | Status : [Member] | Replies : 1
You have an array of index 0-98
You have random function that inserts random number in the array between (1-100)
The validation in the random function is that none of the number can be inserted twice(i.e. unique number would be inserted in the array)
Find the missing number?

Sum up the number between 1-100 (You will get a value X)
Sum up the number of the inserted array( You will get a value Y)

Missing Number = X-Y

For Example:
Suppose i have array of index 0-4
Suppose i have numbers from 1-5 (i.e the sum of numbers between 1-5 is 15)
Suppose i have 1,4,5,2 in the my array. The sum of inserted number is 12

Missing Number = 15-12 =3

Happy Thinking!



Posted by: Rocknisha on: 7/28/2012 [Member] Starter | Points: 25

Here is the collection of some really nice logical & aptitude test questions for interview or quiz preparation

[url=http://howtofreak.com]How to[/url],How to freak

Shantanupatel, if this helps please login to Mark As Answer. | Alert Moderator

Have you tried Aspose: http://aspose.com/file-tools

Login to post response