Print numbers from 1 to 10 using two threads, where one thread prints odd numbers and the other prints even numbers, ensuring the output is strictly sequential (1, 2, 3, ... 10).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.