1 2 3 4 5 6 7 8 9 10 11 12 13
clear //Given E=1.5 //V Vd=0.5 //V P=0.1 //W //Calculation Imax=P/Vd V=E-Vd R1=V/Imax //Result printf("\n Value of resistance is %0.3f ohm",R1)