Question: Write a program in C that inputs a vector of resistance values of any length from the keyboard terminated by a sentinel value of -999.

Write a program in C that inputs a vector of resistance values of any length from the keyboard terminated by a sentinel value of -999. If a resistor value is negative, the user will be prompted to key in the correct resistance value. The program will display both the individual resistance value and the calculated equivalent resistance. Make sure that if any of the resistance value is 0, the equivalent resistance is equal to 0. The program must contain the following function req the following prototype: double req (double res[], int n) whereras is the array of resistors and n is the number of resistors. Your function must be recursive. A non-recursive solution will earn no marks. Assume that all the resistors read by the function have positive resistance values.

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!