blob: b83b012c8e8f6c2681689e1d6c4c53f61a72c83a (
plain)
1
2
3
4
5
6
7
8
|
//Chapter 2, Problem 9
clc;
P=100; //power in watt
V=250; //voltage
I=P/V; //calculating current
R=V/I; //calculating resistance using Ohms law
printf("(a) Current = %f A\n\n\n",I);
printf("(b) Resistance = %d ohms",R);
|