Write a program that calculates the resistance of an electrical circuit consisting of two resistances.

Write a program that calculates the resistance of an electrical circuit consisting of two resistances. Resistors can be connected in series or in parallel.

program Om;
var r1, r2: real;
s: char;
begin
write (‘Enter the values of the two resistances in ohms separated by a space:’);
readln (r1, r2);
write (‘Specify the method of connecting the resistances (in parallel – p, in series – s):’);
readln (s);
case s of
‘p’: write (‘The resistance of the circuit is equal to’, (1 / (1 / r1 + 1 / r2)): 6: 2, ‘ohm.’);
‘s’: write (‘The resistance is equal to’, (r1 + r2): 6: 2, ‘ohm.’)
end
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.