Walmart Inc. forecast lower-than-expected profit for the full year, suggesting that the uncertain economic environment is hitting even the world’s largest retailer.