3i Infotech Placement: Sample Questions 588 - 590 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 588

Edit

Describe in Detail

Essay▾

Explain fork () system call.

Explanation

Chart of Parent, Fork and Child
  • System call fork () is used to create processes.
  • Takes no arguments and returns a process ID.
  • Creates a new process- becomes the child process of the caller.
  • After child of child instructions in fork () are executed.

Fork

  • Returns a negative value, if the child process creation is unsuccessful.
  • Returns positive value containing the ‘process id’ , to the parent.

Process ID

  • An integer identifying a process
  • getpid () retrieves the process ID assigned to the process.
  • After system call to fork () , a simple test can identify the child.

Question 589

Question

MCQ▾

If then

Choices

Choice (4)

a.

10

b.

15

c.

18

d.

12

Answer

d.

Explanation

Here,

We are asked to find the value of .

Multiplying the given equation by 3,

So, value of is 12.

Question 590

Edit

Describe in Detail

Essay▾

What is function overloading and operator overloading?

Explanation

Define Parts of Compile Tme Polymorphism

Function Overloading:

  • Function overloading means that functions with same name can be defined with different parameters or different number of parameters.
  • Appropriate function is identified by the compiler by number or types of parameters.
  • Reduces the investment of different function names and used to perform similar functionality by more than one function.

Operator Overloading:

  • Operator overloading allows operators on user defined objects.
  • All overloaded operators provides syntactic sugar for function calls that are equivalent.
  • Without fundamental language changes, operator overloading provides a pleasant facade.

Developed by: