4 Replies - 153 Views - Last Post: 06 December 2012 - 09:42 AM Rate Topic: -----

#1 crisdeveloper  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-December 12

Counter using loop while

Posted 05 December 2012 - 03:01 PM

Hello, guys! im new in this forum and i studing C++. My problem is this: i put a number 1000 in parameter of my method count, but it dont show all the numbers! show starting of 702 till 1000. It only show all the numbers when i put a small number like 100, for example!


void count(int n)
{

  int i = 0;

  while(i < n){

	  i++;

	  printf("%d\n", i);
  }


}

void _tmain()
{
	
	count(100);

    system("pause");

}




Is This A Good Question/Topic? 0
  • +

Replies To: Counter using loop while

#2 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2194
  • View blog
  • Posts: 5,222
  • Joined: 10-September 10

Re: Counter using loop while

Posted 05 December 2012 - 03:06 PM

Your screen buffer or terminal/console emulator can only show so many results (which may be adjustable, depending on your setup). The results you're looking for have scrolled off the top and were replaced by the results that followed.
Was This Post Helpful? 1
  • +
  • -

#3 crisdeveloper  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-December 12

Re: Counter using loop while

Posted 05 December 2012 - 06:52 PM

thank you for answer me and forgive for ive put my doubt in wrong place!
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8316
  • View blog
  • Posts: 31,836
  • Joined: 06-March 08

Re: Counter using loop while

Posted 05 December 2012 - 09:10 PM

Greg's answer is right and would apply to both C++ and Java
but next time, as it is C++ code, post in the C++ forum :)
Was This Post Helpful? 0
  • +
  • -

#5 crisdeveloper  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-December 12

Re: Counter using loop while

Posted 06 December 2012 - 09:42 AM

ok! I undestand!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1