An exclamation mark is used at the end of a command, interjection and or a declaration.
– That is utter rubbish!
– “Yes!” he replied, “I want it now!”
Exclamation marks are placed inside quotation marks if the information being quoted is an exclamation. Otherwise, the exclamation mark is placed outside the quotation marks.
– The dog barked “woof!” at the man.
– Stop referring to me as “Oreo”!
Note, commas and periods are not used after exclamation marks.
– “I have been doing this for years!” he said. NOT “I have been doing this for years!”, he said.
– The disaster is finally over! NOT The disaster is finally over!.