Hey,
Im having a problem with sorting numbers. I want to sort 4 numbers in orders of size i.e. if the order is 5,8,9,2 I would like it to distinguish the highest number (which in this case would be 9) and lowest (2). Could someone suggest how i would go about doing this. Ive declared each number as num1, num2, num3, num4 and declared both the highestNum and lowestNum. If someone could show any way of doing thsi be it an if statement or array i'd be extremely greatfull.
-Flipz- 0 Newbie Poster
Recommended Answers
Jump to PostYeah simple bubble sort
Define an array [] of integers
Define a counter , lets say its called 'i'Use a for loop with another loop nested in it
e.g For (i = 0; i<Size of array; i++)
what this means is start the counter at …
Jump to Postthat one done get the lowest
Jump to PostNo more C# code in VB.NET forum
woops i think thats my fault i seem to have confused everyone by using a java-like for loop - it wasnt really meant to be any language in particular, just pseudocode.
All 10 Replies
timothybard 12 Posting Whiz
jbennet 1,618 Most Valuable Poster Team Colleague Featured Poster
Teme64 215 Veteran Poster
-Flipz- 0 Newbie Poster
isaackhazi 0 Newbie Poster
jbennet 1,618 Most Valuable Poster Team Colleague Featured Poster
Teme64 215 Veteran Poster
jbennet 1,618 Most Valuable Poster Team Colleague Featured Poster
isaackhazi 0 Newbie Poster
isaackhazi 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.