A one-pot reaction is presented for the synthesis of pyridopyrimidine and quinoline derivatives, which are nitrogen-containing heterocyclic compounds with various medicinal properties. Chalcone derivatives are generated in situ from the reaction of aldehyde and ketone derivatives, then trapped by enaminone or uracil to produce the corresponding pyrido[2,3-d] pyrimidine and quinoline derivatives.