Green’s Dictionary of Slang

what the hell! excl.

also what in hell!
[mid-19C+]

1. a statement of resignation, of acceptance.

2. a general excl. indicative of annoyance or surprise.