Write multi-threaded code where one thread prints the even numbers and another prints the odd numbers, so the combined output appears in order (1, 2, 3, ...). Use a mutex and condition variable.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.