After commenting Line 2 "Hello" is printed nine times but commenting Line 1 outputs "Hello" more than nine times. My question is what's the role of '\n' in this?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int tmp[10], i, n=0;
for(i=0;i<9;i++)
{
tmp[i]=fork();
if(tmp[i]>0)
break;
else
{
printf("Hello\n"); // ---- Line 1
printf("Hello "); // ---- Line 2
}
}
}