India, June 1 -- Enterprise technology company Hewlett Packard Enterprise Co. (HPE) on Monday reported a swing to profit in the second quarter as revenues grew, driven by strong growth in networking and AI-related infrastructure demand. The company also raised its full-year outlook.

Net earnings attributable to common stockholders were $595 million, or $0.44 per share, compared with a loss of $1.08 billion, or $0.82 loss per share, in the prior-year quarter.

Adjusted net earnings attributable to common stockholders increased to $1.11 billion, or $0.79 per share, from $516 million, or $0.38 per share, a year earlier.

Revenue surged 40.0% to a record $10.68 billion from $7.63 billion last year.

Gross margin improved to 36.5% from 28.4%. A...