NEW DELHI, JULY 13 -- Legislators from the Indian states and national parliament today voted for a new president following months of bitter public acrimony between Prime Minister Rajiv Gandhi and the outgoing president, Zail Singh.

Vice President Ramaswami Venkataraman, Gandhi's Congress Party nominee, is heavily favored to win and become India's eighth president in its 40 year history. Results are expected to be announced on Thursday. The new president will begin his five-year term July 24.

Gandhi's political troubles have become so deep-seated, however, that the normally routine presidential election has turned into another test of strength for the young prime minister. Some political observers have recalled the 1969 election when Gandhi's mother, the late prime minister Indira Gandhi, used that year's vote for a showdown against party dissidents.

India's presidency is nominally a ceremonial position, modeled after the relationship of the British monarchy to the elected parliamentary government. The president nominates officials, has a role in creating laws and presents the government's position in parliament, but can do no more or less than the government instructs him.

Since India has no established monarchy, however, the presidency and the men who have held that position sometimes have become embroiled in the often tumultuous politics of this huge south Asian nation, raising in the process some fundamental questions about India's democratic form of government.

With few exceptions, the politicalization of the presidency has never been more pronounced than during the last year of Zail Singh's tenure. The president, elected in 1982, has been engaged in political warfare with Gandhi, using the limited powers of the position to raise questions about legislation and about the prime minister's faithfulness to the constitution.

The 42-year-old prime minister and his aides, in turn, have shown open contempt for Singh, 70, drawing charges that they were dragging down the office of the presidency while demeaning the man.

Relationships became so strained that there were widespread reports in the Indian press during the past several weeks that the president had been canvassing opposition parties and disaffected Congress Party members for support for another term.

Whether the reports reflected a serious effort or simply political sniping remains unclear, but ultimately Singh did not declare his candidacy.

Venkataraman, 75, a south Indian from Tamil Nadu, is one of the last active politicians with political roots in the days of the nationalist movement to oust the British. He was trained as a lawyer but has been in government since the mid-1950s, first at the state level and then as finance and defense minister in the early 1980s before becoming vice president.

He is opposed by V.R. Krishna Iyer, a highly respected retired Supreme Court judge. Before he became a judge, he was elected as a state assemblyman and later joined the first elected communist government in the world, that of E.M.S. Nambooridipad in Kerala state in 1952, as minister of law. He is supported by a loose coaltion of opposition parties.

A third candidate, Mithilesh Kumar, managed to get the backing of 21 independent state assemblymen in Bihar to win a ballot spot, but has no real support.

India's president is elected by a complex proportional representation system under which members of the national parliament and members of the lower houses of state assemblies each have a vote.