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


Please Help Members By Posting Answers For Below Questions

What causes a runtime error c++?

584


Can c++ be faster than c?

604


Explain the scope of resolution operator.

633


How can I improve my c++ skills?

556


Differentiate between an inspector and a mutator ?

705






Explain the problem with overriding functions

609


Write a program which uses functions like strcmp(), strcpy()? etc

621


Is eclipse good for c++?

540


What is a flag in c++?

609


Is c++ vector dynamic?

574


What is c++ & why it is used?

592


Explain about templates of C++.

676


Why would you use pointers in c++?

623


What is a multimap c++?

682


How do you flush std cout?

570