2-Alkylquinazolines were obtained from amidines by reaction with ammonia. The synthesis has been applied to the preparation of 2, 9-dialkylpyrimido [4, 5-] indoles, in a one pot reaction, from 1-alkyl-2-azidoindole-3-carbaldehydes, a secondary amine and aldehydes and reaction with ammonia.