//Chapter 1, Example 1.4 clc //Initialisation r=50 //resistance in ohm i=3 //current in ampere //Calculation p=i^2*r //Power in watts //Results printf("Power P = %.1f Watt",p)