4 B: as we know every act judged by intention. Lets say, a muslim intended to ask forgiveness to Allah after committing shirk and/or kufr knowingly. But in case, if he dies in the situation of committing kufr and /or shirk, will Allah forgive him? Will he go to paradise?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Whoever commits an act of Kufr (disbelief) intending to repent of it but dies before repenting will be among the people of Hellfire and will abide therein eternally. Such a person is a disbeliever both outwardly and inwardly because he did not revert to Islam before his death. His intention to repent of such disbelief is of no effect in this case because he does not revert to Islam based on his mere intention to do so; it is imperative that he proclaims the Shahaadatayn (The Two Testimonies of Faith), regrets his sin, gives it up, and resolves never to commit it again in the future. These are the pillars of a sincere repentance. It is for this reason that the scholars warned against the danger of procrastinating repentance because you might die before repenting of your sin and accordingly incur loss upon yourself for your failure to repent. As for the Hadeeth stating that deeds are judged according to the intentions (behind them), it is irrelevant in this situation.
Allah Knows best.
You can search for fatwa through many choices