1 2 3 4 5 6 7
//Example 5_1 clc(); clear; //To calculate the work done Fs=8 //units in meters W=Fs*round(cos(%pi/2)) //units in Joules printf("The work done is W=%d Joules",W)