blob: 9d6d66200bf39982837182a8cf58979ca9f43c14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//Chapter 1, Example 1.7
clc
//Initialisation
v1=10 //voltage
v2=0 //voltage
r1=200 //resistance in ohm
r2=300 //resistance in ohm
//Calculation
v=v1*(r2/(r1+r2)) //voltage
//Results
printf("Voltage, V = %d V",v)
|