Hi, I can find the largest number. But I can not find the second largest number. I dont know where to start.
m7r23
0
Newbie Poster
Recommended Answers
Jump to Postif ( num > max ) { max2 = max; max = num; }
Jump to PostErm,
if (num > max) { max2 = max; max = num; } else if (num > max2) { max2 = num; }
Jump to PostThough the question has been answered, 'where to start' is important.
Before you start coding, always think out what you want the program to do on paper.
For this particular problem, what you need to think about is:
If I can find the largest number, how can I …
All 12 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
Drowzee
3
Posting Whiz in Training
m7r23
0
Newbie Poster
m7r23
0
Newbie Poster
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
m7r23
0
Newbie Poster
m7r23
0
Newbie Poster
m7r23
0
Newbie Poster
jeevsmyd
-2
Junior Poster
Adak
419
Nearly a Posting Virtuoso
jeevsmyd
-2
Junior 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.