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
Fares Ayyad
NA
235
74k
Swapping elements in array using c#
Jan 20 2017 5:51 PM
Hello
if i have an array consist of 5 integers from 1 to 5 like this
int
[] numbers={1,2,3,4,5};
So, i want to swap the last number (5) with the first number (1)
And
Swap the second number (2) with the fourth number (4)
So the number 3 (which is in the middle will stay in the middle with index of 2).
I tried to swap between the first and last number in this manner:
numbers[4]=numbers[0];
But i don't know if this is true, and what about the second swapping?
Reply
Answers (
1
)
Uploaded Picture remains showing in C# form
How to create excel file using c# windows form