Question: You inherited the following codes from a previous programmer in your position. 1: #include 2: 3: int main(void) 4: K 5: int voltage = {2,

 You inherited the following codes from a previous programmer in your

You inherited the following codes from a previous programmer in your position. 1: #include 2: 3: int main(void) 4: K 5: int voltage = {2, 4, 8, 7, 9}; 6: int current = {1, 4, 3, 8) 7: int *p = &current[2]; 8: 9: printf("The average voltage is : "); 10: 11: 10: printf("%d", p); 11: return 0; 13: 12: 14: a) Analyse and modify the program to generate the average value of the voltage and evaluate line 9 using a programming software. Ensure that your program is general enough such that the code is still relevant even if each value and the number of voltage reading changes (more or less than five readings)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!