Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 ......got stuck, what am i suppose to do
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
noradII




PostPosted: Thu Jun 01, 2006 4:29 pm   Post subject: ......got stuck, what am i suppose to do

who do i write a program that reads in a series of positive integers and output the range of the integers, that is, the interval from the smallest to the largest? Sad
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: Thu Jun 01, 2006 4:34 pm   Post subject: (No subject)

My suggestion would be to have 2 variables, one that stores the value of the smallest number, and one that stores the value of the larger number. As you go through the numbers, if you come across one that smaller than the one in the variable containing the smallest number, then you replace that value with the number you're currenting reading. Do the same with the largest number.
Cervantes




PostPosted: Thu Jun 01, 2006 5:45 pm   Post subject: (No subject)

noradII, please use more descriptive topic titles. "......got stuck, what am i suppose to do" tells us nothing of your problem. The more descriptive the title, the more help you'll get.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: