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
Ram Prasad
NA
326
18k
Help with C# to compare data
Feb 12 2019 11:45 PM
am trying to compare a set of integers (say alpha) with the result i am getting (say result) if result is in alpha i should be able to get the output as mentioned in example below alpha = 0,1,2,3,4,5,6,7 result = 0,5,6
Final answer should be ABBBBAAB and what i am getting is ABBBBBBB BBBBBABB BBBBBBAB
public static int[] alpha = new int[8] { 0,1,2,3,4,5,6,7 };
public static void Main(string[] args)
{
// Lines of code
foreach (var jagged in manager.JaggedList)
{
// Lines of code
foreach (var item in Items)
{ Console.Write(item.Number); //For Ex output here is (0,5,6)
List<int> result = new List<int>();
result.Add(item.Number);
foreach (var Var in result)
{
for (int i = 0; i < alpha.Length; i++)
{
if (result.Contains(alpha[i]))
{
Console.Write(alpha[A]);
}
else
{
Console.Write(alpha[B]);
}
}
}
Console.WriteLine();
}
}
Reply
Answers (
1
)
What is short-circuiting?
code for login table