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 are the advantages of inheritance in c++?
What is else if syntax?
If you don’t declare a return value, what type of return value is assumed?
How can I disable the "echo" feature?
What is the difference between a reference and a pointer?
Define a nested class.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
What is heap sort in c++?
What is c++ redistributable?
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?
What is a loop? What are different types of loops in c++?
What is guard code in c++?
Explain class invariant.
What do you mean by overhead in c++?
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?