He will be the chief guest at India's Republic Day celebrations Jan 26.
Obama had earlier visited India in 2010.
Earlier in the day, a White House communique told Obama regretted that he will not be able to visit Agra during his three-day stay to India starting tomorrow.
"President Obama and the First Lady will travel to Riyadh on Tuesday, January 27 in order to pay respects to King Salman bin Abdulaziz and the family of the late King Abdullah bin Abdulaziz.....
"Accordingly, we adjusted the schedule in coordination with the Indian Government so that the President would be able to depart India following his speech on Tuesday to stop in Riyadh during the return trip to meet with King Salman and other Saudi officials and offer his condolences on behalf of the American people. The President regrets that he will be unable to visit Agra during this trip. The Vice President will remain in Washington," a White House statement said.
The statement, issued in New Delhi by the US embassy, also mentioned that the US Vice President was originally to have led a delegation to Saudi Arabia on the President's behalf.