3i Infotech Placement: Sample Questions 299 - 300 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 299
Describe in Detail Essay▾
Predict the output or error (s) for the following:
main ()
{
int i =300;
char ⚹ptr=&i;
⚹++ptr=2;
printf ( “%d”,i);
}
Explanation
In the program
int i = 300; |
|
char ⚹ ptr = &i; |
|
⚹+ + ptr = 2; |
|
printf ( “% d” , i) ; |
|
Question 300
Explanation
- Form system call creates a new process- child process, which runs concurrently with the current process and the current process is called parent process.
- After a new child process is created, both processes execute the next instruction following the fork () system call.
- Child process uses the same CPU registers open files used by parent process.
- It take no parameters and returns integer value
- Form copies the parent՚s page tables for child using copy-on-write pages.
- Only penalty incurred is time and memory to duplicate the parent՚s page tables, and to create a unique task structure for the child.