3
Answers

Array No of elemets

harish reddy

harish reddy

7y
163
1
//Write a program in C# Sharp to count a total number of duplicate elements in an array.
Console.WriteLine("Enter first length");
int firstlength=int.Parse(Console.ReadLine());
int[] firstarray = new int[firstlength];
int k=0;
Console.WriteLine("Enter second length");
int secondlength = int.Parse(Console.ReadLine());
int[] secondarray = new int[secondlength];
int i, j;
for (i = 0; i < firstarray.Length; i++)
{
firstarray[i] = int.Parse(Console.ReadLine());
}
i = 0;
for (j = 0; j < secondarray.Length; j++)
{
secondarray[j] = firstarray[i];
i++;
Console.WriteLine(secondarray[j]);
}
for (i = 0; i < firstarray.Length; i++)
{
for (j = 0; j < secondarray.Length; j++)
{
if (firstarray[i] == secondarray[j])
{
k++;
}
}
k = 1;
}
 
Struck here pls help 
Answers (3)
0
Ehsan Sajjad

Ehsan Sajjad

NA 5k 426k 7y
Please refer to the following article which explains how to add multiple columns search :
 
 http://www.c-sharpcorner.com/article/grid-view-with-server-side-advanced-search-using-jquery-datatables-in-asp-net-mv/
 
0
Pramod Thakur

Pramod Thakur

NA 7.3k 791.5k 7y
Read this article.
 
http://tomasp.net/blog/dynamic-linq-queries.aspx/
 
Mark as answer if you find helpful. 
0
Mangesh Gaherwar

Mangesh Gaherwar

NA 4.1k 70.8k 7y
Group compulsory and optional parameter in the Query
 
and or them accordingly