In this article, a new and simple procedure was designed for the preparation of pyrazolopyranopyrimidine and dihydropyrano[2,3-c]pyrazole derivatives using the reaction between hydrazine hydrate, aryl aldehydes, malononitrile or barbituric acid, and ethyl acetoacetate using Fe3O4@THAM-piperazine as a solid nanocatalyst in a solution of water and ethanol at 60 degrees C. The present process offers advantages like easy workup, short reaction time, non-toxicity, and the use of green solvent. Moreover, recyclability studies were carried out that showed a high potential of reusing and recovering capability.