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

Is string an object in c++?

0 Answers  


Is string data type in c++?

0 Answers  


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

0 Answers  


Write a C++ program that asks the user to choose a number between 1 and 1000. Then, your program should be able to guess the number by asking the user no more than 10 yes/no questions. Use a while loop in your program

1 Answers  


What does override mean in c++?

0 Answers  






What are stacks?

0 Answers  


what is multi-threading in C++?

0 Answers  


How a macro differs from a template?

0 Answers  


What is the use of typedef?

0 Answers  


string somestring ; Which of the following choices will convert a standard C++ string object "somestring" to a C string? a) Copy.somestring () ; b) somestring.c_str () c) &somestring [1] d) std::cstring (somestring) e) (char *) somestring

1 Answers   Quark,


Write about c++ storage classes?

0 Answers  


What are the various storage classes in C++?

0 Answers   Fidelity,


Categories