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 above program when porcessor one is sleeping, so when printf is executed wht will be the output?

AnswerBot
1y

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
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter