When a writer makes a forceful contrast between expectations and reality, creating a surprise ending for readers, the literary device which the author use is:
D. irony
There are three types of irony and the situation stated above refers to situational irony wherein the expected ending varies from the actual ending.