clear// //Variables P = 150 *12/1000.0 //Power consumed by 12 bulbs (in kilowatt) t = 10.0 //Time (in hours) //Calculation W = P * t //Energy used (in kWh) //Result printf("\n The energy used is %0.3f kWh.",W)