Program to count total number of duplicate numbers in an array and print count with c#

preview_player
Показать описание
Program to count total number of duplicate numbers in an array and print count with c#
#CSharpProgramWithArray#ArrayInCSharp#LearnConsoleApplicationWithCSharp#ProgramSnippets
Рекомендации по теме
Комментарии
Автор

if anyone just needs to find the count of dulicate elements

i m pasting code just in case if anyone needs it.
public class Program
{
public static void Main()
{
int[] a = { 2, 2, 5, 6, 8, 4, 5, 6, 1, 4};
//int[] b = new int[10];
//int[] c = new int[10];
int count = 0;

for(int i =0 ; i < a.Length; i ++)
{
for(int j = i+1; j < a.Length;j++)
{
if(a[i]==a[j])
{

}
}
}
Console.Write(count);
}
}

curiosity