//Locating the centroid of T section //Refer fig. 9.10 //due to symmetry the centroid lies on y axis //distance of centroid from top is ybar=(100*20*10+20*100*70)/(100*20+20*100) printf("Centroid of T-section is on the symmetric axis at a distance of %.2f mm from the top",ybar)