clc // Given that l = 1 // length of pendulum in meter m = 2 // mass of particle in kg g = 9.8 // acceleration due to gravity in m/sec^2 // Sample Problem 8 on page no. 7.25 printf("\n # PROBLEM 8 # \n") T = 2 * %pi * sqrt(l / g) printf("\n Standard formula used \n T = 2 * pi * sqrt(l / g). \n") printf("\n The time period of pendulum = %f sec.",T)