Simplifies a given input -- C Program