Dinosaurs did not fly or swim. A flying Pterosaurus or a swimming ichthyosaurus were not dinosaurs. They were closely related.

Most of the dinosaurs groups were extinct long before the K-T mass extinction of 65 million years. The rest of them died out at this time but many bird species luhich are technically dinosaurs survived it.