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.
Answer Posted / 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 |
Post New Answer View All Answers
Why null pointer is used?
What does new do in c++?
What are static member functions?
What is a virtual destructor? Explain the use of it?
Define a constructor?
What is the identity function in c++? How is it useful?
What is endl c++?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
Is c++ vector a linked list?
How is computer programming useful in real life?
When should overload new operator on a global basis or a class basis?
What is a multimap c++?
Why cstdlib is used in c++?
Why is c++ still popular?
Is c++ double?