I want you to do some simple calculations on a very simple circuit. The circuit consists of a power source, a resistance load and a couple of wires. You are going to calculate the power used by the circuit and the current flowing through it. The equation for power is:
power = volts2 / resistance
And current is determined by
current = volts/resistance
Voltage is measured in, well, volts, resistance in ohms, power in watts and current in amperes.
--> g++ -o circuit1 circuit1.c --> ./circuit1 Enter the voltage in volts 10 Enter the resistance in ohms 10 The power value is 10 watts The current value is 1 amperes