
PROGRAM THREE
Ohm's law states that the voltage (V) in a circuit is equal to the
current flowing in amperes (I) multiplied by the resistance in the
ciruit (R) [ ie, E = I * R ]. Write a program to enter in the
values of resistance and current, displaying the voltage which
would exist.
program OHMSLAW (input, output);
var resistance, current, volts : real;
begin
writeln('Please enter resistance value');
readln( resistance );
writeln('Please enter current value');
readln( current );
volts := current * resistance ;
writeln('The voltage is ', volts )
end.
Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.