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!
Select
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?
Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits