The Family Of Imran - 3:39 "He was standing in the temple praying when the angels said to him, "God gives you good news of John, an honorable, chaste and righteous prophet who will confirm the Word of God."
When Prophet Zachariah was old, he asked for a child, not to continue his lineage, but because he foresaw that his people might go astray after him, and he wanted a prophet to lead his people:
The Family Of Imran/3:37 "Her Lord accepted her offering in a good way and raised her like a beautiful flower under Zechariah´s care. Every time Zacharias came to her in the temple, he found food with her. When he asked her, "Mary, from where does this come to you?"she replied, "It is from Allah. Allah gives provision to whom He wills without calculation."
The Family Of Imran/3:38 "Zacharias prayed to his Lord there: "My Lord,"he said, "give me a pure offspring from Your Presence; You are the Hearer of prayer."
The Family Of Imran/3:39 "He was standing in the temple praying when the angels said to him, "God gives you good news of John, an honorable, chaste and righteous prophet who will confirm the Word of God."
The Family Of Imran/3:40 "When he said, "My Lord, how can I have a son when I am old and my wife is barren?", he said, "Yes, but Allah does what He wills"."
The Family Of Imran/3:41 "He said, "My Lord, give me a sign."He said, "Your sign is that you do not speak to the people except by sign for three days. Remember your Lord much, and think of Him morning and evening."

Mary/19:2 This is a remembrance of your Lord´s mercy on His servant Zachariah.
Mary/19:3 He called out to his Lord in a secret supplication
Mary/19:4 "Lord,"he said, "the bones in my body have become loose, and my head is gray and burning. In supplication to you, Lord, I have never despaired."
Mary/19:5 I fear for those who depend on me after me, and my wife is barren. Grant me an heir from You.
Mary/19:6 Let him be heir to me and to the tribe of Jacob. My Lord, make him one whom You favor.
Mary/19:7 Zakariyya, we give you good news of a son. His name is Yahya. We have not created like him before.
Mary/19:8 My Lord, how can I have a son? My wife is barren and I am very old.
Mary/19:9 "Yes,"he said, "your Lord said, ´It is easy for me. I created you before and you were nothing."
Mary/19:10 "Lord, give me a sign,"he said. "Your sign is that you will not speak to the people for three consecutive nights."

The Prophets/21:89 "And Zachariah. He had supplicated to his Lord thus: "My Lord, do not leave me alone; You are the best of heirs."
The Prophets/21:90 We accepted his prayer and gave him John. And We improved for him the condition of his wife, because they were competing in good deeds, and they called upon Us in hope and fear. They were those who respected Us.