I have 3 array of int data type and i want to find common numbers from arrays without using standard method.
I tried this:--
class Program
{
static void Main(string[] args)
{
int[] array1 = { 1, 4, 2, 8, 7 };
int[] array2 = { 7, 5, 9, 1, 0,2,15};
int[] array3 = { 7, 5, 9, 1, 0, 2, 15,56,23 };
for (int i=0; i
{
for (int j = 0; j < array2.Length; j++)
{
for (int k = 0; k < array1.Length; k++)
{
if (array1[i] == array2[j] || array1[j] == array2[k])
{
Console.WriteLine(array1[i]);
}
}
}
}
Console.ReadKey();
}
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Uzma KhanPosted Sep 25, 2018, 2:07 AM