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
Can we make any program in c++ without using any header file and what is the shortest program in c++.
What is function overriding in c++?
What is a try block?
How many namespaces are there in c++?
What are the various compound assignment operators in c++?
What is the this pointer?
How would you obtain segment and offset addresses from a far address of a memory location?
What are the advantages of prototyping?
Why c++ is so important?
When does the c++ compiler create temporary variables?
What is encapsulation in C++? Give an example.
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What apps are written in c++?
When is the copy constructor called?
What is &x in c++?