Computer Science, asked by shireensuheib215, 4 months ago

Create a thread named NumberThread to generate a random number. If the generated number is even create a thread SumThread which generate a set of random numbers and find the sum of all numbers. If the generated number is odd create another AvgThread that generate a set of random numbers and find the average of all numbers. Write a driver class to demonstrate the multithreading program.

Answers

Answered by snehildhiman7
1

Answer:

generate a random number. If the generated number is even create a thread SumThread which generate a set of random numbers and find the sum of all numbers. If the generated number is odd create another AvgThread that generate a set of random numbers and find the average of all numbers. Write a driver class to demonstrate the multithreading program.

Similar questions