clc clear //Input data x=0.03//Length stretched by the spring in m m=0.25//Mass of the body in kg //Calculations k=(m*9.8)/x//Force constant of the spring in N/m //Output printf('Force constant of the spring is %3.2f N/m',k)