Write a program. there are 1..n numbers placed in an
array in random fashion with one integer missing. find the
missing number.



Write a program. there are 1..n numbers placed in an array in random fashion with one integer miss..

Answer / jayakrishnan

Array.Sort(a);
var b= a.Where((o,index)=>o!=index+1);
Console.WriteLine(b.First()-1);

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More C Sharp Code Interview Questions

Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.

0 Answers   Mind Tree,


c# code to Count number of 1's in a given range of integer (0 to n)

0 Answers  


how can i split sting in textbox in windows application using c# .net

2 Answers  


how to change password in .net with c # with ado.net and also SQL server 2008 change password

1 Answers  


Give the code for Handling Mouse Events?

0 Answers  






How to use ASP.NET 2.0's TreeView to Display Hierarchical Data?

1 Answers  


write a Program to copy the string using switch case.

0 Answers   Mind Tree, Wipro,


Coding for using Nullable Types in C#?

1 Answers  


How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)

0 Answers  


Write a program to count the number of characters, number of words, number of line in file.

2 Answers   Mind Tree,


how do i copy textbox contents of 1 form to another form

4 Answers   Wipro,


program for straight line(y=mx+c)

0 Answers   Mind Tree,


Categories
  • ASP.NET Code Interview Questions ASP.NET Code (46)
  • VB.NET Code Interview Questions VB.NET Code (9)
  • C Sharp Code Interview Questions C Sharp Code (51)
  • ADO.NET Code Interview Questions ADO.NET Code (8)