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)