blob: 8669d45f4a671cce8bafcce8edf08810a462e673 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
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)
|