Predict the output of the following program code in UNIX?
Submitted by: Administratormain()
{
fork();
printf("Hello World!");
}
Answer:
Hello World!Hello World!
Explanation:
The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process.
Submitted by: Administrator
{
fork();
printf("Hello World!");
}
Answer:
Hello World!Hello World!
Explanation:
The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process.
Submitted by: Administrator
Read Online UNIX Operating System Job Interview Questions And Answers
Top UNIX Operating System Questions
☺ | What is inode in UNIX OS? |
☺ | What are the Unix system calls for I/O? |
☺ | What is a FIFO in UNIX OS? |
☺ | How do you change File Access Permissions in UNIX OS? |
☺ | What are links and symbolic links in UNIX OS file system? |
Top Operating System (OS) Categories
☺ | RTOS Interview Questions. |
☺ | Windows 7 Interview Questions. |
☺ | MAC Operating System Interview Questions. |
☺ | Disk Operating System (DOS) Interview Questions. |
☺ | Shell Scripting Interview Questions. |