It's due to the British, the main language is Hindi as it is the language of majority, India basically was a lot of different kingdoms, after independence unification started. Hindi was to be made the national language but the south opposed as they didn't want the language to be imposed on them. So both English and Hindi are used.