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 a program in C, also in C++, Pascal, Cobol, Fortran, Perl, PHP, ADA , and C# that computes the sublist S of a list L = (X1 . . . Xn) obtained as follows: (a) The first element of the sub-list S is an odd number in list L. (b) No odd number in L has an index lower than the index of the element selected at the previous step (1a). (c) The last element of the sublist S is an even number in list L. (d) No even number in L has an index higher than the index of the element selected at step 1c. (e) All the other elements of the sublist are the cubes of the elements of the first list, having indexes between the two selected numbers. (f) If such numbers (like the ones mention in Step 1a or Step 1c) do not exists for the input list, the program should display an appropriate message, and the sublist S is an empty list. All the situations generating an empty list should be detected by your program.
List must be stored as arrays. You choose the exact format of the input data, but it must be documented. Here is a possible example of running a program: $cc x.x -o x $./x<< HERE 12
4 6 3 11 24 25 30 36 47 101 103 7 HERE EOF 3 1331 13824 15625 27000 36 $ $./x<< HERE2 10 4 6 8 24 125 301 1367 47 101 10001 HERE2 EOF The list is empty (no even number after an odd number). $ $./x<< HERE3 11 4 6 8 24 125 128 301 1367 47 101 10001 HERE3 EOF 125 128 $