Write a program for calculating the resistance of an electrical circuit consisting of 2 resistances.

Write a program for calculating the resistance of an electrical circuit consisting of 2 resistances. Resistors can be connected in parallel or in series. How should the result be displayed on the screen: Select the type of connection: 1 – serial, 2 – parallel Enter the 1st resistance Enter the 2nd resistance Circuit resistance = … Ohm

program rezist;
var r1, r2: real;
t: integer;
begin
writeln (‘Enter your connection type’);
writeln (‘(Serial – 1, parallel – 2)’);
read (t);
writeln (‘Enter the value of the first resistance in (Ohm)’);
read (r1);
writeln (‘Enter the value of the second resistance in (Ohm)’);
read (r2);
if t = 1 then writeln (‘Circuit resistance’, r1 + r2, ‘Ohm’);
if t = 2 then writeln (‘Circuit resistance’, 1 / (1 / r1 + 1 / r2), ‘Ohm’)
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.