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.