Question: Need help with Fortran code both of these codes plz 2. Write a Fortran program that defines two one-dimensional arrays, each with 20 real elements.
Need help with Fortran code both of these codes plz


2. Write a Fortran program that defines two one-dimensional arrays, each with 20 real elements. Use the array constructor notation we discussed in lecture to initialize the values of the first array to the following values (you may cut and paste these to save some typing) 0.4961 -0.0574 -0.3934 0.4133 0.4618 0.3686 -0.0495 0.3477 -0.4219-0.4954 0.4156 0.2749 0.1003 -0.2402 0.2481 -0.4162 -0.2711 Make sure that no line in your program is longer than 80 characters. Remember that the ampersand character & allows you to continue a line Initialize the second array with zeros. Then, use a loop to fill the second array with the sum of all of the values in the first array up to that point. In other words, the value in the first element of the second array will be 0.2481, the value of the second element of the second array will be 0.2481 + 0.4133 = 0.6614, and so on.(Hint: The last value in the second array will be-0.2645.) Note that a conditional (an if statement) may be required here. Use a loop to print out the second array, 5 elements at a time, using the same format shown above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
