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
Does a derived class inherit or doesn't inherit?
What is pointer in c++ with example?
What are advantages of c++?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
Is the declaration of a class its interface or its implementation?
How to give an alternate name to a namespace?
Which one is a preferred language C or C++? Why?
What is ostream in c++?
Which coding certification is best?
What is the best way to take screenshots of a window with c++ in windows?
What are the two types of comments, and how do they differ?
What is function declaration in c++ with example?
Out of fgets() and gets() which function is safe to use and why?
What is data abstraction? How is it different from data encapsulation?
To what does “event-driven” refer?