data array

Apr 29, 2012 at 7:22am
#include<iostream.h>
#include<conio.h>
#include<math.h>
main()
{
int i;
int A[1000];

for(i=0;i<1001;)
{
A[i]=i;
cout<<"\n"<<A[i];
i=i+1;
}
getch();
}



when i run this program....the numbers starts from 701 but they ought to start from 0 or 1....can any one please explain this???
Apr 29, 2012 at 8:05am
The program probably outputs very fast so that you have no time to see it all.
In the loop condition it should be i<1000.
Apr 29, 2012 at 8:10am
then is there any way to see the whole outcome???
Apr 29, 2012 at 8:19am
add a getch() to your loop so you have to press a key to continue with each number
Apr 29, 2012 at 8:58am
Maybe you can tell whatever it is cout is outputting to to not discard old output until some higher limit.
Topic archived. No new replies allowed.