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
harish reddy
NA
162
33.5k
For loop in Array
Feb 12 2018 1:23 AM
Hi,
In the code below, why is my Else statement not printing?
.
Alos how can i fid the largest element of any array ?
static void Main()
{
int[] firstarray = new[] { 1, 2, 3, 4, 5, 6, 7, 9 };
for (int i = 0; i <= firstarray.Length-1; i++)
{
for (int j = 1; j>=firstarray.Length-1; j++)
{
if (firstarray[i]>firstarray[j])
{
Console.WriteLine(i);
}
else if (firstarray[i] < firstarray[j])
{
Console.WriteLine(j);
}
}
}
}
Reply
Answers (
7
)
The type or namespace name 'allen PLC' does not exist in
How to show percentage with Kendo switch with jquery?