We can imagine connecting 2 resistors in series , resulting in a higher resistance, or in parallel , reducing the resistance.
Starting with:
double r1 = 4.7;
double r2;
Calculate and display the series resistance given by:
series = r1 + r2
and the parallel resistance , given by :
Parallel = (r1 * r2) / (r1 + r2)


Riaan Naidoo7 reputationPosted Jul 27, 2014, 4:22 AM EDT
Farhan ShariffRank #2,004 · 725 reputationPosted Jul 27, 2014, 4:34 AM EDT
{
double r1 = 4.7;
double r2,s,p;
Console.WriteLine("Enter r2 : ");
r2 = double.Parse(Console.ReadLine());
while (r2 != 0)
{
s=r1+r2;
p = (r1 * r2) / (r1 + r2) ;
}
Console.WriteLine("Series Resistance : "+s);
Console.ReadLine();
}
Seshan Pillay8 reputationPosted Jul 27, 2014, 4:52 AM EDT