clear// //Variables R = 330 //Resistance (in ohm) VS = 5 //Source voltage (in volts) //Calculation VD = VS //Voltage drop across diode (in volts) VR = 0 //Voltage drop across the resistance (in volts) I = 0 //Current through circuit //Result printf("\n Voltage drop across the diode is %0.3f V.\nVoltage drop across the resistance is %0.3f V.\nCurrent through the circuit is %0.3f A.",VD,VR,I)