blob: c31e42c82b2d5809214caebe4946b5d37e5ace03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
clear//
//Variables
P = 150 *12/1000.0 //Power consumed by 12 bulbs (in kilowatt)
t = 10.0 //Time (in hours)
//Calculation
W = P * t //Energy used (in kWh)
//Result
printf("\n The energy used is %0.3f kWh.",W)
|