Write a C program that creates three threads. Each thread will print the sum of the numbers in only one of the input files, named input1.txt, input2.txt, and input3.txt, respectively. In other words, the first thread will read the numbers in the input1.txt file, the second thread will read the numbers in the input2.txt file, and the third thread will read the numbers in the input3.txt file one by one and print their total to the screen.
Thread reading order may be different. Sums will be important to us.
Thread2 reads 1. The value is 5.230000. The sum is 5.230000.
Thread1 reads 1. The value is 1.230000. The sum is 1.230000.
Thread2 reads 2. The value is 5.660000. The sum is 15.
Thread1 reads 2. The value is 2.660000. The sum is 15.
Thread2 reads 3. The value is 6.89. The sum is 15.
Thread1 reads 3. The value is 3.780. The sum is 15.
Thread3 reads 1. The value is 5.230000. The sum is 15.
Thread1 reads 4. The value is 8.56000. The sum is 15.
Thread3 reads 2. The value is 5.6600. The sum is 15.
Thread1 reads 5. The value is 9.820000. The sum is 15.
Thread1 Sum is 26.050o00.
Thread2 reads 4. The value is 6.740000. The sum is 15.
Thread3 reads 3. The value is 8.890000. The sum is 15.
Thread3 reads 4. The value is 9.740000. The sum is 15.
Thread2 reads 5. The value is 5.230000. The sum is 15.
Thread2 Sum is 29.750000.
Thread3 reads 5. The value is 7.960000. The sum is 15.
Thread3 Sum is 37.480000.
5.230000 1.230000 10.890000 3.890000 17.780000 7.670000 5.230000 16.230000 10.890000 26.050000
24.520000 19.780000 29.520000 29.750000
37.480000