Numbers 14:33-34

14:33 and your children will wander in the wilderness forty years and suffer for your unfaithfulness, until your dead bodies lie finished in the wilderness. 14:34 According to the number of the days you have investigated this land, forty days – one day for a year – you will suffer for your iniquities, forty years, and you will know what it means to thwart me.

Exodus 24:18

24:18 Moses went into the cloud when he went up the mountain, and Moses was on the mountain forty days and forty nights.

Exodus 34:28

34:28 So he was there with the Lord forty days and forty nights; he did not eat bread, and he did not drink water. He wrote on the tablets the words of the covenant, the ten commandments.