Question: C code program help. I am trying to find the total parallel resistive load. This is what I have so far. It does run, it

C code program help.

I am trying to find the total parallel resistive load. This is what I have so far. It does run, it does ask for numbers. But it doesn't calculate. It just comes out "The parallel is: 0.00". I have tried 3, 4, 5 and 3.2, 4.3, 5.4. Still only shows 0.00. I have tried several combinations of putting different data types in both main.c and the rest of it.

Any help or ideas would be helpful. Thank you.

(There are other questions that were in the code but I have deleted it before posting. So there might be some random code still left in here. But I tried really hard to comment out everything but the part I was working on. )

#define _CRT_SECURE_NO_WARNINGS #include #include #include

int main(void) {

//Resistance Problem 1 double resistor1 = 0.0, resistor2 = 0.0, resistor3 = 0.0; double inverse_resistance = 0.0; double parallel_resistance = 0.0; resistor1 = get_number5_r1(); resistor2 = get_number6_r2(); resistor3 = get_number7_r3(); inverse_resistance = get_inverse_resistance(resistor1, resistor2, resistor3); parallel_resistance = calculate_parallel_resistance(inverse_resistance); display_parallel_resistance(parallel_resistance); }

//Total Resistance Baggage /*int get_number5_r1(void) { double resistor1 = 0.0; printf("Please enter the resistance of the first resistor: "); scanf("%lf", &resistor1);

return resistor1; } int get_number6_r2(void) { double resistor2 = 0.0; printf("Please enter the resistance of the second resistor: "); scanf("%lf", &resistor2);

return resistor2; } int get_number7_r3(void) { double resistor3 = 0.0; printf("Please enter the resistance of the third resistor: "); scanf("%lf", &resistor3);

return resistor3; }

//I split the next two up because I thought that it would help fix the remainder problem. //As of now it has not.

get_inverse_resistance(double resistor1, double resistor2, double resistor3) { double inverse_resistance = 0.0; inverse_resistance = ((1.0 / resistor1) + (1.0 / resistor2) + (1.0 / resistor3)); return &inverse_resistance; } calculate_parallel_resistance(double inverse_resistance) { double parallel_resistance = 0.0; parallel_resistance = (double)((1.0 / inverse_resistance));

return (double)parallel_resistance; } display_parallel_resistance (double parallel_resistance) { printf("The parallel resistance is: %.2lf ", parallel_resistance); }*/

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!