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

Event Handling in C# Triggering a Button

1 Answers  


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,


"c sharp" code for factorial using static variables

9 Answers  


Coding for using Nullable Types in C#?

1 Answers  


Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with 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 add a value from textBox over an existing certain column in SQL Server

0 Answers  


program for straight line(y=mx+c)

0 Answers   Mind Tree,


Write a program to convert postfix expression to infix expression.

0 Answers   Mind Tree,


working with arrays

1 Answers  


Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.

1 Answers   Cognizant,


how does the below eqation proceed to be solved: x*=y+z options: x=x*y+z or x=x*(y+z)

1 Answers  


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)