Lesson 1 of 15
Ohm's Law
Ohm's Law
Ohm's Law is the most fundamental relationship in circuit analysis:
V = I · R
Where:
- V = voltage across the resistor (volts, V)
- I = current through the resistor (amperes, A)
- R = resistance (ohms, Ω)
The Three Forms
Rearranging gives you the form you need:
I = V / R (find current from voltage and resistance)
V = I · R (find voltage from current and resistance)
R = V / I (find resistance from voltage and current)
Physical Intuition
Think of a resistor as a pipe carrying water:
- Voltage is the pressure pushing the water
- Current is the flow rate
- Resistance is how narrow the pipe is
Double the pressure (voltage) → double the flow (current). Double the pipe restriction (resistance) → half the flow.
Examples
| Voltage (V) | Resistance (Ω) | Current (A) |
|---|---|---|
| 12 V | 4 Ω | 3 A |
| 5 V | 1000 Ω | 0.005 A (5 mA) |
| 9 V | 3 Ω | 3 A |
| 120 V | 60 Ω | 2 A |
Your Task
Implement double ohms_law(double v, double r) that returns the current through a resistor given voltage v and resistance r.
TCC compiler loading...
Loading...
Click "Run" to execute your code.