#include #include // use #gcc -lm to compile while using math.h int main() { float k1=0,k2=0,k3=0; printf("Enter the values of spring constants in format : k1,k2,k3 "); scanf("%f,%f,%f",&k1,&k2,&k3); float temp121 = 1/(k1+k2+k1); float temp23 = 1/(k2+k3); float kEq = 1/(temp121 + temp23); // energy = 0.5 * k * x*x float x = sqrt( 1000/(0.5 * kEq) ); printf("The distance x for energy 1000 is %.03f\n",x); return 0; }