TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anoop kumar
NA
19
2.7k
Array sorting problem
Sep 24 2018 10:33 AM
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<array1.Length;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();
}
}
Reply
Answers (
1
)
how to use latest news display in header page mvc
Create text file use path from config file in c#