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


Please Help Members By Posting Answers For Below Questions

What are the advantages of inheritance in c++?

657


What is else if syntax?

679


If you don’t declare a return value, what type of return value is assumed?

542


How can I disable the "echo" feature?

611


What is the difference between a reference and a pointer?

599






Define a nested class.

615


Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

612


What is heap sort in c++?

600


What is c++ redistributable?

622


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

563


What is a loop? What are different types of loops in c++?

593


What is guard code in c++?

642


Explain class invariant.

586


What do you mean by overhead in c++?

580


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1738