Use the specific constructions and the characteristics of each programming language to write the following programs: The input is from standard input, and all output is standard output. Use the constructions in the slides/examples and avoid using built-in functions that are not necessary, or you can program these functions yourself (mainly for C++/Php/Perl).
Write the following program in C, and also in C++, Pascal, Cobol, Perl, PHP, ADA, and C#: Write an interactive program that plays the following game: (a) We have stored internally M arrays of size at most M. A selection function will select n arrays of size at most n from the existing arrays. This selection function is created by each of you and arrays cannot be empty. (b) Write a program to interactively guess an element from each of the n lists (stored internally) in at most k tries, where k is also an input (integer) value n < k < 3n. The program should precalculate the maximum and minimum number from all lists and should tell the user if the number is out of bounds. Therefore, your input k followed by at most k tries. (c) The program will determine if the numbers are in the arrays. If yes, then it is a successful guess, i.e., the number guessed, say r, is in array i, for all 1 ≤ i ≤ n, then the program will reveal all the numbers in the array i, 1 ≤ i ≤ n containing r.
In other words, once you guess a number in one array, you display all the numbers in that array. We don’t know how the numbers are distributed between the arrays. Certain values may be present in a few arrays, or in all arrays. After each guess, successful or not, the number of tries left should be displayed. The player wins if all numbers are revealed after k tries and loses otherwise.