PLEASE DO NOT SAY THAT YOU ARE ANSWERING IF YOU ARE NOT GOING TO ANSWER! Write a
ID: 3640430 • Letter: P
Question
PLEASE DO NOT SAY THAT YOU ARE ANSWERING IF YOU ARE NOT GOING TO ANSWER!
Write a program to find the vector sum C = A + B where A, B and C are one dimensional arrays of type int and of size N (assume max value for N is 100)
The main thread should initialize A and B with random integers between 0 and 10, then creates N threads such that the ith thread calculates Ci = Ai + Bi
Finally, the main thread prints the three arrays; A, B, and C
Hint: Use the function random() to get random integers, apply mod operator (%) to make the generated random number within a range. Use srandom() function to randomize the seed, so that each execution of your program generates a distinct set of random integers.