There is a array of 99 cells and we have to enter 1-100
elements in it , no two elements would repeat , so the is one
no. missing because 99 cells and 1-100 nos. so we had to
implement a function to find that missing no.

Answers were Sorted based on User's Feedback



There is a array of 99 cells and we have to enter 1-100 elements in it , no two elements would rep..

Answer / amty

Get the sum of numbers
total = n*(n+1)/2

Subtract all the numbers from sum and
you will get the missing number.

Is This Answer Correct ?    41 Yes 2 No

There is a array of 99 cells and we have to enter 1-100 elements in it , no two elements would rep..

Answer / shiva sahu

Get the sum of numbers
total = n*(n+1)/2

Subtract all the numbers from sum and
you will get the missing number.

this is not mine,but this ans is right

Is This Answer Correct ?    22 Yes 0 No

Post New Answer

More C++ General Interview Questions

What are friend classes?

0 Answers  


Which software is best for programming?

0 Answers  


difference between the c++ and c languages

4 Answers   Wipro,


What is difference between class and function?

0 Answers  


What are the classes in c++?

0 Answers  






Specify some guidelines that should be followed while overloading operators?

0 Answers  


What is the use of data hiding?

0 Answers  


What is a built-in function?

1 Answers  


What is ios flag in c++?

0 Answers  


Can constructor be private in c++?

0 Answers  


what is polymorphism?

14 Answers   Accenture,


What is difference between malloc()/free() and new/delete?

0 Answers  


Categories