.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

find out repeat number in array without using comparision

Posted By: ramya     Posted Date: April 11, 2011    Points:5   Category :C#
An array containing {1,2,3,4,5,6,6,7,8,9,10}. Find out the repeated number without using comparison.

Responses
Author: Arul             
Posted Date: April 11, 2011     Points: 20   

Hi,

you can use LINQ to find repeated items if you are using framework 3.0.

Thanks,
Arul

Author: shankey             
Posted Date: April 11, 2011     Points: 20   

hello,

Try this,

int[] array1 = { 1,2,3,4,5,6,6,7,8,9,10 };
int[] array2 = Array.FindAll(array1,
element => element == 6);

this will give you 2

Thanks,
Shankey

Shankey


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend