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
George Phillips
NA
1
773
How to use arrays to choose one number from many numbers
Mar 19 2014 3:48 AM
First, Ask user to create an array next, ask him/her to enter many numbers then, find a smallest number int the array after that, move the index of the smallest number in array three times forward then change the number in current index which has number 0 and when you arrive the end of the array and pass it move the index to the beginning of the array and if the beginning of the array had been changed to 0 so move the index just once to forward and do this while just one number hasn't changed to 0 so print this number at last.
for Example:
Suppose user has opted the array with it's element which is below. we must do three steps:
first step:
Find the smallest number which is in this example (3) then move the index of the smallest number three times to forward the change the number in current index which is (10) to 0 and do this while you arrived to the end of the array
note: When you arrived to the end of the array move the index of array to the beginning of that . and if the begging of the array had been changed to 0 in this case you must move the index of array just once to forward
8
7
4
3
9
12
0
16
13
0
second step:
Continue the first Step but in this step we must not find the smallest number of array
note: When you arrive to the place of array that had been changed to 0 please underestimate to count this in the index movement.
8
7
0
3
9
0
0
16
13
0
Third step:
Continue the second step
note: When you arrive to the place of array that had been changed to 0 please underestimate to count this in the index movement.
0
0
0
0
0
0
0
16
0
0
Print the 16 to the Unleashed Number
Reply
Answers (
0
)
Problem in Gridview when refresh page..
how to open user control when click on another user control.