Question: Why wont it accept my loops? any help with the conditionals i have to create for total resistance? Written in C. #include #include int main(void){

Why wont it accept my loops? any help with the conditionals i have to create for total resistance? Written in C. Why wont it accept my loops? any help with the conditionals i

#include #include

int main(void){

int resistance_1 = 0; int resistance_2 = 0; int resistance_3 = 0; int total_resistance = 0; char your_name[5];

printf("Please enter your name: "); scanf("%4s",&your_name);

printf("Please enter the value of your first resistance: "); scanf("%d",&resistance_1);

printf("Please enter the value of your second resistance: "); scanf("%d",&resistance_2);

printf("Please enter the value of your third resistance: "); scanf("%d",&resistance_3);

if(total_resistance1 = resistance_1+resistance_2+resistance_3){ printf("Dear Ms. or Mr. %4s, ",your_name); printf("The Total Resistance is %d ohms since r1,r2,r3 are connected in [series] manner.",total_resistance1); } else if(total_resistance1 = 1/((1/resistance_1)+(1/resistance_2)+(1/resistance_3)){ printf("Dear Ms. or Mr.%4s, ",your_name); printf("The Total Resistance is %d ohms since r1,r2,r3 are connected in [parallel] manner.",total_resistance1 } else(total_resistance1 = resistance_1 + (resistance_2*resistance_3) / (resistance_2+resistance_3){ printf("Dear Ms. or Mr.%4s, ",your_name); printf("The Total Resistance is %d ohms since r1,r2,r3 are connected in [combination] manner.",total_resistance1); }

getchar(); return 0;

}

3. Create a script that will take User Input -from Keyboard while running- with if, else if, and else conditionals to calculate the Total Resistance (R_T) 1) r1 , r2, and r3 are connected in series manner. (RT-r1m2+r3) 2) ri, r2, and r3 are connected in parallel manner.(R-T = 1/((1/rl)+(1/r2)+(1/r3)) ) 3) rl is connected to the parallelly connected r2 and r3 in series manner R_T-rlr2xr3/(r2+r3)) The output should be Dear Ms or Mr. [Your Name], The Total Resistance is [your result] ohms since rl, r2, r3 are connected in [series, parallel, combination] manner. The script should prompt the user to type in values for the following variables while the program is running - Your Name, rl,r2, and r3

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!