Stocks rose on Tuesday as investors snapped up shares in the technology sector ahead of results from Hewlett Packard , betting it may be the latest company to beat estimates.

The Dow Jones industrial average <.DJI> rose 27.72 points, or 0.33 percent, to 8,531.80. The Standard & Poor's 500 Index <.SPX> gained 6.27 points, or 0.69 percent, to 915.98. The Nasdaq Composite Index <.IXIC> climbed 16.77 points, or 0.97 percent, to 1,749.13.

(Reporting by Leah Schnurr)