1 2 3 4 5 6 7 8 9 10
clear //Given L=2.0 //H i=2 //A //Calculation U=0.5*L*i**2 //Result printf("\n Amount of energy spent during the period is %0.3f J", U)