MUMBAI/NEW YORK (Reuters) - Walmart Inc has agreed to pay $16 billion for a roughly 77 percent stake in Indian online shopping site Flipkart, the U.S. retailer's biggest foreign investment as it battles rival Amazon.com Inc in one of the world's biggest emerging markets.