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
18.2k
Not able to get rid of IndexOutOfRangeException
Apr 23 2019 9:46 PM
static void Main(string[] args)
{
int[] A = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
int[] B = { 4, 8, 8, 12, 15 };
int? prev = null;
{
for (int i = 0; i < B.Length; i++)
{
for (int j = 0; j < A.Length; j++)
{
if (B[i] < prev+1)
{
if (B[i] == A[j-1])
{
Console.WriteLine(B[i]);
i++;
}
if (B[i] == A[j])
{
Console.WriteLine(B[i]);
i++;
}
else
{
Console.WriteLine(0);
}
}
prev = B[i] ;
Console.WriteLine();
}
}
}
}
Reply
Answers (
2
)
BLL file to manage Lookup tables in one or more BLL files
what about Ticketing System / IT Support