
Asked in Marvel Realtors
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...
Top Software Engineer Interview Questions Asked at Marvel Realtors
Q. Can pointers be added or subtracted?
Q. Given the head pointer of a doubly linked list, reverse the list using both recu...read more
Q. How do you identify if a system is big-endian or little-endian?
Interview Questions Asked to Software Engineer at Other Companies
Top Skill-Based Questions for Marvel Realtors Software Engineer
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
Software Development Interview Questions and Answers
250 Questions
SQL Interview Questions and Answers
250 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

