# 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,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;
}`````` 