The Prophet (Pbuh) revealed his Prophethood at the age of 40 year as instructed by Allah (swt).
Musa Alahi salam traveled 40 years in the desert.
Musa spent 40 days on Mount Sinai where he received the 10 commandments.
Prophet Ibrahim spent 40 days in a fire and lived because Allah made the fire like flowers.
Prophet Yunus was in a whales mouth for 40 days.
On the 40th ayat of surah baqarah Allah changes the topic.
Forty was the number of days that Prophet Ilyas spent in the wilderness before God appeared to him in a cave on Mount Horeb.
Forty was the number of days that Prophet Isa was tempted in the desert by Satan.
Muhammad (PBUH) was praying and fasting in the cave for 40 days.
Muhammad (PBUH) then had 40 followers to spread the religion of Islam.
Prophets Dauud and Suleiman each ruled for forty years.
Regarding the flood that Noah encountered, it is said that for forty days water continued to pour from the heavens and to stream out over the earth.
Prophet Isa walked the desert and fasted in the wilderness for forty days.
There is also a hadith from Prophet Mohammad (PBUH) that the prayers of a person who gossips would not be accepted for forty days and nights. ( Al-Kafi, Vol. 6, p. 400)
Imam Ali has narrated from Prophet Mohammad (PBUH) that one who memorizes and preserves forty hadith relating to their religious needs shall be raised by Allah as a learned scholar on the Day of Resurrection.
It is said that a person’s intellect attains maturity in forty years, everyone according to his own capacity.
It is believed that one who assists a blind man for forty steps becomes worthy of entering heaven.
Imam Baghir has said: “The prayers of someone who drinks wine are not accepted for forty days.”
Believers have also been encouraged to devote themselves to God Almighty for forty days to see the springs of wisdom break forth from their hearts and flow from their tongues.
So as you can see 40 is represented many times in Islamic matters, but also took place in the other books (Bible, Torah). There are probably more then this, What do you think is the reason for the high value?
Allah knows all.
Create a movie on the number 40?