|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: Kind of off topic c programming question.
I'm not going to give you code as this is for a school assignment however why not trying looping through the numbers and comparing against the upper and lower bound.
Assign the high value and low value variables to a null value Loop through each input Check if the high value is null, if so assign the input to the high value Check if the low value is null, if so assign the input to the low value If the lower/upper bounds are not null... set the high value to the input if the input is greater than the current high value set the low value to the input if the input is lower than the current low value Take some time to think over the problem - flowcharts are always helpful. You also have a few errors in your program...slow down, look at your code. Debugging is an art. I'll give you a few tips: Watch for typos - I see an invalid comment Watch your assignments - looking at the main structure of your code where it compares the numbers, I see an incorrect assignment. Plus when posting code on the forum please use [ CODE ][ /CODE ] (without spaces). Good luck! ![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Off Topic | Brett Elflord | Chit-Chat | 1 | 30-11-2007 18:05 |
| OFF TOPIC: av switch | matt111 | Electrical | 2 | 21-03-2004 15:34 |
| Threads getting off topic | Mike Soukup | CD Forum Support | 29 | 20-08-2001 04:08 |
| chat/off-topic | Brandon Martus | General Forum | 6 | 06-08-2001 10:10 |
| off topic thread | mike o'leary | Chit-Chat | 4 | 31-07-2001 22:55 |