Question: Question 5 (10 marks) a) Oiven the following array X, What is the output after executing the program segment [6 m) 5.1? X 20 |

Question 5 (10 marks) a) Oiven the following array X, What is the output after executing the program segment [6 m) 5.1? X 20 | 60 | 100 | 140 | //program segment 5.1 int 1 - 2 x 10 = x(1) printf("%.2f ", x(0)); printf("%.2f ", *(1) +2); printf("%.2f ", *(1-21) printf("%.2f ", *(1+1), printf("%.2f ", x(0+2) = x(0+ x(11) printf("%.2f ", **%(11): b) Write the C statements to: 1. Declare and initialize array weight with values as shown in Figure 5 below. ii. Assign the last element with a new value, which is 78. [2 m) 64 48 52 97 Figure 5: array weight iii. Declare an array of strings named friends that can store 5 names, and the maximum length of characters is five (5). Initialize the array with the following names: Ann, Bill, Chad, Dave, Eddy. Print the name Dave from the array, 12 m)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
