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 / 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 View All Answers
What is the syntax for a for loop?
What are the types of pointer?
When is the copy constructor called?
Explain polymorphism?
How many characters are recognized by ANSI C++?
Describe friend function & its advantages.
What is the difference between the parameter to a template and the parameter to a function?
What is the average salary of a c++ programmer?
What is static function? Explain with an example
What is the need of a destructor?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
How do we balance an AVL Tree in C++?
What do c++ programmers do?
How does the copy constructor differ from the assignment operator (=)?