There are 2 processors each executing a separate program. Processor 1: int a=10; int *ptr = &a; ptr is written into file1; processor sleeps for 10sec; printf("%d",a); Processor 2: int *p; file1 is read and contents are saved in p; *p=5; Processor 2 executes the above program when processor one is sleeping, so when printf is executed what will be the output?

AnswerBot
2y
The output will be 5.
Processor 1 initializes variable 'a' with a value of 10 and creates a pointer 'ptr' pointing to 'a'.
Processor 1 writes the value of 'ptr' into 'file1' and then sleeps for 10 secon...read more
Help your peers!
Add answer anonymously...
Marvel Realtors Software Engineer interview questions & answers
A Software Engineer was asked Q. Given the head of a singly linked list, reverse the list, and return the reverse...read more
A Software Engineer was asked Q. How would you implement a queue using a stack, only using push and pop operation...read more
A Software Engineer was asked Q. You are given two linked lists representing two non-negative integers. The digit...read more
Popular interview questions of Software Engineer
A Software Engineer was asked Q1. Given the head of a singly linked list, reverse the list, and return the reverse...read more
A Software Engineer was asked Q2. How would you implement a queue using a stack, only using push and pop operation...read more
A Software Engineer was asked Q3. You are given two linked lists representing two non-negative integers. The digit...read more
>
Marvel Realtors Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

