//Determine force P //refer fig.8.19 //(a) P at floor level //Applying virtual work principle //P*delta(x)-200*delta(y)=0 P=100*tand(30) //N //(b) If the rope is used instead of force P //refer fig.8.20 //Taking C as origin //Applying virtual work principle //(-3*T*cosd(theta)+400*sind(theta))*delta(theta)=0 T=(400*tand(30))/3 //N printf("\nP=%.2f N\nT=%.2f N",P,T)