because printf() is "buffered," meaning printf() will group the output of a process together. While buffering the output for the parent process, the child may also use printf to print out some information, which will also be buffered. As a result, since the output will not be send to screen immediately, you may not get the right order of the expected result. Worse, the output from the two processes may be mixed in strange ways. To overcome this problem, you may consider to use the "unbuffered" write. .

Sir, vfork is generally used when you are expected to call "exec".
and fork has "Copy on write" mechanism now so fork even doesn't duplicate address space until needed.

Difference between the two is that, when vfork() is called, Parent leans it address space to Child and
parent process is suspended, This continues until the child process either exits, or calls exec(), at which point the parent process continues.

Sir, vfork is generally used when you are expected to call "exec".
and fork has "Copy on write" mechanism now so fork even doesn't duplicate address space until needed.

Difference between the two is that, when vfork() is called, Parent leans it address space to Child and
parent process is suspended, This continues until the child process either exits, or calls exec(), at which point the parent process continues.