BANGALORE – Nandan Nilekani and V. Balakrishnan, the two high-profile former Infosys executives who ran for parliamentary seats in the information technology hub of Bangalore, styled themselves as professionals who knew how to get things done in the hopes of appealing to young voters who were clamoring for change.

India Votes News and analysis on the world’s largest election.

Bangalore’s young indeed sought change, but what many were seeking was not a new technocrat but a strong leader who promised development.

The Bharatiya Janata Party swept all three parliamentary seats in this southern Indian city, crushing the two executives as well as several other candidates. Mr. Nilekani, of the Indian National Congress, who most recently headed the Indian government’s biometric identity program, was routed by the B.J.P.’s five-time winner, Ananth Kumar. Mr. Balakrishnan, a candidate for the new Aam Aadmi Party, was defeated by the incumbent B.J.P. lawmaker, P.C. Mohan, and took third place in the contest in Bangalore Central.

Two distinguished women who contested in Bangalore South, the child rights activist Nina Nayak of the Aam Aadmi Party and the civil rights campaigner Ruth Manorama of a local party, were also trounced.

Many young voters in Bangalore said they had chosen the B.J.P. because of its leader, Narendra Modi, drawn by his promise of a stable government and better governance.

“He spoke about issues that mattered to us,” said Abhishekam Swamy, 29, a software engineer with the Indian unit of a multinational company. Mr. Swamy said he and his friends hoped for a better India, an improved economy and a healthy job market.

India needs 12 million new jobs every year, and the last five years have been disastrous for the country, said Mr. Balakrishnan, the Bangalore Central contestant. “They see Mr. Modi as a messiah coming to deliver jobs.”

Bangalore could well be a microcosm for the country’s young voters in an election where a record 120 million people registered to vote for the first time.

Voters in Bangalore were spoiled for choice by an array of candidates like Mr. Nilekani and Mr. Balakrishnan, who came from middle-class beginnings and enjoyed success in business. Given their technology backgrounds, both candidates crunched data, targeted voters and used social networks in their campaigns.

However, many younger Bangalore voters were swayed by Mr. Modi’s personality. “He has the aura of a leader and his development record in Gujarat speaks for itself,” said Reshma Lobo, 30, a software professional. “He is said to be a bit of a dictator but perhaps that is what our country needs at this time – somebody who can stand his ground and get things done.”

Though the data in Bangalore appeared to show that just over half of the city’s total voters cast ballots, less than the national average of 66 percent, the enthusiasm among young voters was visible on social networks.

“The peer pressure spilled over to social networks; everybody showed off their inked fingers and boasted about voting for a change,” said Sundaresh G., 31, a project manager at a telecom multinational who voted in the Bangalore South constituency.

Politics was never a topic for discussion among teenagers until this election, said Sneha Balakrishnan, 18, a student of the National Public School in the Rajajinagar neighborhood who is also the daughter of the former Infosys executive and Aam Aadmi candidate.

Ms. Balakrishnan, said political change came up often in conversations. “My friends were talking about elections bringing a ray of hope,” she said.

The quality of candidates in the city was better than ever before, said Aditya Rao, 26, a business analyst at a multinational firm. “There were plenty of sensible, honest, smart people with the right intent,” he said. But voters ultimately chose somebody they thought could do the job.

Young voters wanted a stable government in Delhi to replace the dysfunctional one of the last five years, said Mr. Balakrishnan. “People were fed up and voted for the promise of growth,” he said.

Mr. Nilekani and Mr. Balakrishnan conceded defeat early Friday but said they were in politics for the long run.

Mr. Nilekani said he would continue to advocate Brand Bangalore and would donate funds to set up a nonprofit that would work on issues like public transport and drinking water.

Mr. Balakrishnan, too, said he would immerse himself in development work in the city. “By continuing, I want to change young people’s perception about politicians,” he said.