working c sop soln