Does word "snap" have the same meaning in the following two sentences?

To snap a whip.

The pipe snapped.
different meanings