According to your variant write a program. That program reads a sequence of positive numbers from standard input. The sequence is terminated by number 0 and does not include that 0. For each number in sequence program should create a new thread. The thread gets some how the value of appropriate number and a handle of thread created for previous number or INVALID_HANDLE_VALUE if the thread is created for first number in the sequence. Each of that threads do the following:
Try to suspend a thread which handle it gets. Test the retrieved number. Resumes previously suspended thread. Exit with code corresponding to result of step 2.
The program reads a path to some program from standard input then creates a new process after all additional threads have finished. The created process for each possible thread exit code gets environment variable with name 'tecXXX' where XXX replaced by value of exit code and the number of threads terminated with this exit code as value. The program waits until a new process initial thread termination.
If number is greater than 143 then thread exits with code 1. If number is less than 105 then thread exits with code 18. Otherwise thread exits with code 105.