U.S. stocks ended higher on Friday after mostly in-line U.S. inflation data, but the three major indexes posted losses for the week. The S&P 500 and Nasdaq snapped three-week streaks of weekly gains.