#include <stdio.h>
#include <unistd.h>
int main(void)
{
int i;
for (i = 0; i < 2; i++) {
fork();
printf("-");
}
return 0;
}
The result of this program is 8"-" : "--------". But if I change 'printf("-");' into 'printf("-\n");', the result of this program will become 6"-": "-\n-\n-\n-\n-\n-\n". Can anyone tell me why?