Skip to main content
1 of 2

Scala, 55 bytes

(l:List[Int],n:Int)=>l combinations 2 find(_.sum==n)get 

Returns a list of the two numbers if they exist and throws an error otherwise. Uncaught, this error will result in an exit status of 1.