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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started