![]() |
|
#1
|
|||
|
|||
Printing a range of inputted values?Hi,
I'm trying to get my program to print out a specific output of numbers that fall into a range of what the user inputs, It works well for one at a time, but I need to get all the numbers to print at once once the user forces the program to stop. This is what I have: CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: Printing a range of inputted values?Quote:
If during the processing of your while loop, I input the values 51, 52, 53, 0, what should be displayed? Is this to happen within the while loop or after the loop exits? |
|
#3
|
|||
|
|||
Re: Printing a range of inputted values?Sorry.
I want it to store all the values entered, then print the values that fall into the range >=50 && <=75 instead of each value that is correct printed after each one. Sorry for not being clear. |
|
#4
|
|||
|
|||
Re: Printing a range of inputted values?Quote:
The simplest solution would be to store results in an array, but the downside of arrays is that they are of finite size. In other words, you would only be able to store values as array elements only up to the what the array can hold. There is a way in which a (somewhat) unbounded numbers can be stored, but I suspect you haven't discussed dynamic storage through either operator new() or functions like malloc() yet. |
|
#5
|
|||
|
|||
Re: Printing a range of inputted values?Quote:
I actually haven't. Looks like I'll be printed them one at a time...Thanks for your help! |
|
#6
|
|||
|
|||
Re: Printing a range of inputted values?Quote:
|
|
#7
|
|||
|
|||
Re: Printing a range of inputted values?CPP / C++ / C Code:
Last edited by Howard_L : 15-Sep-2008 at 00:18.
|
|
#8
|
|||
|
|||
Re: Printing a range of inputted values?Thanks a million Howard!
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert RGB to luma and Chroma component | maximuz | C Programming Language | 17 | 12-Feb-2008 13:54 |
| Please help me to convert a simple C++ program into an object-oriented one. | zekesteer | C++ Forum | 5 | 05-Jan-2008 11:05 |
| Need Help with input files. | Efferus | C++ Forum | 2 | 24-Nov-2007 17:19 |
| Need help generating a random number | Allie | C Programming Language | 7 | 09-Nov-2005 23:18 |
| paasing values in fk_t_diectories | zuzupus | MySQL / PHP Forum | 6 | 12-Aug-2003 08:12 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The