1 2 3 4 5 6 7
//Chapter 1, Problem 7 clc; V=5; //source emf I=3; //current in ampere T=10*60; //time in seconds E=V*I*T; //calculating energy printf("Energy provided = %f kJ",E/1000);