I wrote the following program:
#include <cstdio>
#include <ctime>
int main()
{
time_t t;
int d;
printf("\nHello 1");
time(&t);
d=t;
while (t-d<3) /*wait 3 seconds*/
{
time(&t);
}
printf("\nHello 2");
time(&t);
d=t;
while (t-d<3) /*wait 3 seconds*/
{
time(&t);
}
printf("\nHello 3");
return 0;
}
after build the program, i run it. The program waits 3 seconds to show the line "Hello 1".
why is it written first but executed later?