Emperor of India

Emperor/Empress of India (Shahanshah-e-Hind in Hindustani) was used as a title by the last Mughal emperor Bahadur Shah II, and also by the colonial British monarchs during the British Raj in India.
Sometimes, the term "Emperor of India" is also used to refer to Indian emperors such as Ashoka the Great of the Maurya Dynasty and Emperor Akbar of the Mughal empire. However, they did not claim this title for themselves.
Bahadur Shah II.
Although the Mughal dynasty ruled over most of the Indian subcontinent from the 16th century onwards, they simply used the title Shahanshah (considered in the West to be the same as "emperor"). However dring the Indian revolt of 1857 against the British, the rebel sepoys seized Delhi and called the Mughal Bahadur Shah II as "Shahanshah-e-Hind," or Emperor of India. After the Brtish defeated the rebels, he was captured and was forced to live in Rangoon, Burma in 1858, this ended the rule of the Mughals.
British monarchs.
After the Mughal Emperor ended by the British East India Company, the title "Empress of India" was taken by Queen Victoria from 1 May 1876. 
Prime Minister Benjamin Disraeli is usually credited with creating the title for her. Also, the title was created when it became evident that Queen Victoria's daughter, Victoria, Princess Royal, would become an empress when her husband ascended the German imperial throne, many people thought it was wrong for the daughter to be an empress while her mother was just a Queen.
When Victoria died, and her son Edward VII ascended the throne, his title became "Emperor of India". The title continued until India and Pakistan became independent from the United Kingdom at midnight on 14/15 August 1947.
When signing their name for Indian business, a British King-Emperor or the Queen-Empress used the initials "R I" ("Rex/Regina Imperator/Imperatrix") or the shorter version "Ind. Imp." ("Indiae Imperator/Imperatrix") after their name. This was also used on many British coins, including some 1948 coins of George VI.
King of India and Pakistan.
George VI continued to hold the title King of India for two years during the short Governor-Generalships of Lord Mountbatten and of C. Rajagopalachari until India became a republic on 26 January 1950. George VI remained as King of the United Kingdom and King of Pakistan until his death in 1952. Pakistan became a republic on 23 March 1956, Elizabeth II was Queen of Pakistan for four years.