In DNA, adenine (A) forms hydrogen bonds with thymine (T), and cytosine (C) forms hydrogen bonds with guanine (G). In RNA, uracil (U) replaces thymine (T) as the complementary base to adenine (A).