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

program for addition of fraction(M/N + P/Q = Y/Z)

1 Answers   Mind Tree,


Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1 Answers   Mind Tree,


Code for IP Address Comparison and Conversion in C#?

0 Answers  


working with arrays

1 Answers  


Give the code for Handling Mouse Events?

0 Answers  


Event Handling in C# Triggering a Button

1 Answers  


Code for Reading and writing from a file in c#?

1 Answers  


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

1 Answers   Infosys, Mind Tree,


How to Create a Treeview Menu in ASP.NET with C#?

1 Answers  


program for straight line(y=mx+c)

0 Answers   Mind Tree,


IS Array list is generic or non generic

1 Answers  


Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long

2 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)