In this assignment, you will calculating an histogram for a given array of numbers and for a given histogram interval. First generate an array of 20,000 integer numbers between 1 and 20 as an input array. Have another array, called the histogram array, whose size will be equal 20/(histogram_interval). For example, if the histogram interval is 4, then the histogram array will be a 5-element array: the count of the input numbers between 1-4 will be stored in histogram_array[0], the count of the input numbers between 5-8 will be stored in histogram_array[1], and so on. Write a sequential program for creating the histogram array.
Parallelize the program using OpenMP where different threads process different elements of the input array. Both the input array and the output histogram array are shared among the threads. An OpenMP thread, when processing an element in the input array, increments the count of the corresponding element in the histogram_array. The main thread finally prints the counts of the histogram array.