Added solution in C