During World War I, how was sonar used?

A. to detect submarines
B. to navigate aircraft
C. to track migrating whales
D. to search for shipwrecks

A. to detect submarines