Arrays Exercise:
a) Given the array below:
int nums[5] = {10, 20, 30, 40, 50};
i) What is the value of nums[1]?
ii) What is the value of nums[3]?
iii) Write a C statement that assigns the value 100 to the first element of the array.
iv) Write a C statement that prints the value of the fourth element of the array to
the console.
v) Calculate the sum of the first two elements of the array and write a C statement
to print the sum to the console.
vi) Write a C statement that creates a new variable named result and assigns it the
value of the last element of the array. Then, write another C statement to print
the value of result to the console.