fix this c++ code
compile errors
1 2 3 4 5 6 #include <iostream> #include <cstdlib> using namespace std; int main() 7 int n;//number of elements cout << "Enter number of elements: "; cin >> n; int arr(n);//array with n elements cout << "Enter values: "; for(int i = @; i<n; i++) 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 int v; cin >> v; arr[i] = v; } int res(n);//For finding 1 to n-1 elements there or not // initializing res() with -1 by default (from index 1 to n] for(int i = 0; i <n; i++) { res[i] = } //finding absolute difference and respective result index in res will be changed to 1. for(int i = 0; i < n-1; i++) { int v = abs(arr(i)-arr[i+1]);//adjacent difference values res [v] = 1;//making index value 1 } 1/checking res array for 1 to n-1 values for(int i = 1;i<n; i++) { if(res(1) == -1)//i is not present in adjacent differences. { cout << "Bad sequence : missing " « 1 < endl; return 0; } } cout < "Good sequence" << endl; Most recent submission results: You passed 0 of the test cases. Compile errors: a.cpp: In function 'int main()': a.cpp: 9:13: error: ISO C++ forbids variable length array 'arr' [-Werror-vla] int arrin);//array with n elements a.cpp:17:13: error: ISO C++ forbids variable length array "res' [-Werror-vla] int res[n]://For finding 1 to n-1 elements there or not cclplus: all warnings being treated as errors Submit Absolutely Different Write a program that accepts a list of N numbers as command-line parameters and determines whether or not the absolute value of the differences between adjacent numbers in the list covers all of the values 1..N-1. You may assume that there are no more than 50 numbers total. For example, the list: 2546 meets this condition, because the absolute value of the differences are 12-51 - 3,15-41 = 1,14-61 - 2, which are all the values in the range 1..4-1, or 1.3. Notice the order in which the differences appear does not matter. If the input list meets the condition, report "Good sequence."; if it does not meet the condition, indicate the smallest expected value that is missing. You may assume that data structures are available in adt_queue.h, adt_stack., and adt_priorityqueue, h. Your solution should take at most O(N) time, where N is the number of command-line parameters. Several sample runs are shown below. $ ./eleferences 1 2 4 7 11 16 Good sequence * 12 y $ ./LEErences 13 14 12 16 1 God sequence. $ ./ferences 28 Good sequence pre> The first example has differences of 1,2,3,4,5, the second example has differences of 1,2,4,3. The last example is good because the range from 1..0 is empty and is therefore not missing any values. Below are some that are missing values. $ ./datterences 2341 Bad sequences missing 2. $ ./Lerences 153. 11 Bad sequencei Biesing 2. • Previous Next The first example has differences of 1,2,3,4,5; the second example has differences of 1,2,4,3. The last example is good because the range from 1.0 is empty and is therefore not missing any values. Below are some that are missing values. $ ./differences 2 5 4 7 nad sequence missing 2. $ ./a1fferences 75 3 8 11 Bad sequence missing 2. The first example has differences of 3,1,3, 50 2 is the smallest missing value. The second example has differences of 2,2,5,3, 50 1 is the smallest missing value. Most recent submission results: You passed 0 of the test cases. Compile errors: ..cpp: In function int main() a.cpp19:13error ISO C++ forbids variable length array arr' -error-la int arra;//array with n elements a.cpp:17:13: error: 150 C++ bide variable length array 'res' Herroravia int resin); //por tinding 1 to n-elements there or not colplus: all warnings being treated as errors Most recent submission results: You passed 0 of the test cases. Compile errors: a.cpp: In function 'int main()': a.cpp:9:13: error: ISO C++ forbids variable length array 'arr' [-Werror-vla] int arr[n];//array with n elements a.cpp:17:13: error: ISO C++ forbids variable length array 'res' [-Werror=vla) int res[n];//For finding 1 to n-i elements there or not celplus: all warnings being treated as errors