summaryrefslogtreecommitdiff
path: root/1529/CH2/EX2.11/2_11.sce
blob: ad3295782474f9db2041692e796228024529a996 (plain)
1
2
3
4
5
6
7
8
//Chapter 2, Problem 11
clc;
V=240;              //voltage
R=30;               //resistance
I=V/R;              //calculating current using Ohms law
P=I*V;              //calculating power
printf("Current = %d A\n\n\n",I);
printf("Power = %f kW",P/1000);