Equivalent Series and Parallel Resistance coderinme

Equivalent Series and Parallel Resistance coderinme

Equivalent Series and Parallel Resistance coderinme
Now let us code something related to physics. Resistance! I hope you have heard of this before.
Write a program that finds equivalent series and parallel resistance for a collection of
resistor values. Your program should scan first the number of resistor and then resistor
values. Then calculate the equivalent series and parallel resistance values of the collection
of resistor.
Before coding we should be aware that for series combination, we simply add up all the resistances. And for the parallel combination we first add the inverse reciprocal of each resistor, and then the sum is also inversed to get the anser.

#include<stdio.h>
int main()
{
int a[10],i=1,n;
float res=0, R=0,series = 0, parallel = 0,resistance;
printf("Enter the number of Resistance: ");
scanf("%d",&n);
while(i <= n) {
printf("Enter the value for %d resistor: ",i);
scanf("%f",&resistance);
series += resistance;
parallel += 1.0 / resistance;
i++;
}
parallel += 1.0 / parallel;
printf("Equivalent Series Resistance: %.2f Ohm\n",series);
printf("Equivalent Parallel resitance: %.2f Ohm",parallel);
getch();
return 0;
}

For more programs in C, visit our C Coder Archives

Equivalent Series and Parallel Resistance coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

Leave a reply:

Your email address will not be published.