Rajanikant Hawaldar
One threading is printing 2,4,6,8,10 all even numbers and another thread is printing 1,3,5,7,9 all odd number, how you will print 1 to 10 in sequential manner

One threading is printing 2,4,6,8,10 all even numbers and another thread is printing 1,3,5,7,9 all odd number, how you will print 1 to 10 in sequential manner

By Rajanikant Hawaldar in C# on Jul 14 2021
  • Jun, 2022 23

    1. a.Add(12);
    2. a.Add(1);
    3. a.Add(0);
    4. a.Add(10);
    5. a.Add(4);
    6. a.Sort();

    • 0
  • Raj Gupta
    Jan, 2022 7

    I think create a volatile sorted list class level variable and assign the values in the each thread, once both of the threads are finished, iterate through the sorted list to print the outcome? Please correct me.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS