As an NRI, will dividends be credited to NRE or NRO account?
The dividends will get credited to your NRO or NRE account respectively depending on which of these you've linked to your DEMAT account. Refer to this article to know the difference between and benefits of NRE & NRO accounts.
If you have already linked an NRE account, you do not have to open an NRO account in order for the dividends to be credited & vice versa.
Note: The dividend is credited by the RTA (Registrar and Transfer Agents). There may be cases where they may not be able to credit the dividend to your NRE account. In such cases, a cheque would be sent to your registered address.
In scenarios, where you have both NRE & NRO accounts, they will be mapped to their own respective DEMAT accounts. So depending on which DEMAT account you have the stock eligible for dividends in, the bank account linked to that, either NRE/NRO will get the dividend Credit.