first i used this code:
void pause(long n)
{
clock_t at=clock();
while(clock()-at<=n)
;
}
int main()
{
cout<<1;
pause(100000);
cout<<2;
}
what do u expect? output will be 1(some time gap)2 right? NO..!! its (some time gap)12 how?? Anyways, i changed the pause function as follows-
void pause(long n)
{
for(long i=1; i<=n*n; i++)
;
}
Still same thing..!! why this blank for loop executing first?? but if i do this
void pause(long n)
{
for(long i=1; i<=n*n; i++)
cout<<0 ;
}
Now it happily executes output as 10000000000....(many 0s)....00002