Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Simple Basic Problem in C (http://www.go4expert.com/forums/simple-basic-c-t4865/)

naiya 24Jun2007 20:50

Simple Basic Problem in C
 
If I write the following code in program how can I see the output
for(i=1;i<=15000;i++)
printf("%d\t",i);
Then I can see the numbers from 14761 to 15000.How can I see all the numbers from 1 to 15000.
Please reply as soon as possible.
Thanks in advance.

shabbir 24Jun2007 20:55

Re: Simple Basic Problem in C
 
Offtopic comment:
This is by no means an article and so use the New thread button rather than submit article buttons


Because everything just scrolls up and so you should have some way of having a user input mechanism like scanf, getche or getch functions before the screen-ful of characters goes above the top of the screen.

munkyeetr 24Jun2007 20:58

Re: Simple Basic Problem in C
 
Do you need to use the scroll bar in your output screen and scroll up to see the first 14760 iterations? Because I think that code should work.

naiya 24Jun2007 21:51

Re: Simple Basic Problem in C
 
Yes I want to use the scroll bar in my output screen and scroll up to see the first
14760 iterations. How can I do this without using some scanf or getche functions?

munkyeetr 24Jun2007 22:54

Re: Simple Basic Problem in C
 
No, no, sorry. I just thought it was a simple mistake of not scrolling the Command window up and seeing the first chunk of the programs output.

Disregard what I said, I've been eating paint chips again!

DaWei 25Jun2007 00:13

Re: Simple Basic Problem in C
 
Generally speaking, the buffers associated with a command line interface have a limited number of lines stored, even thought it's typically greater than the number of lines visible. If this is the case, then a scroll bar bill covesr the amount buffered. If the buffer holds less than the amount that has been displayed, then that material is lost.

The whole thing is a somewhat silly question. Computers are not magic. Presume that you have several million tokens and a container to transfer them to. What happens if the container is non-existent, or holds 2000 items, or 2,000,000. It's unlikely that you will find one which is infinite and holds every thing ever displayed to a command window since its creation.

Think of a way to solve the container/token problem and apply it.

naiya 25Jun2007 09:50

Re: Simple Basic Problem in C
 
Thanks to all for your response.


All times are GMT +5.5. The time now is 20:11.