Dear Student,
Andman and Nicobar islands are formed due to tectonic plates activities of Indian Plate abd Burmese minor plate.Its formation is just similar to the formation of Himalaya.The subduction of Indian plate below the Burmese plate resulted in the landmass to arise and create the islands.The Barren and Narcondam islands which are north of the Port Blair are the volcanic island and the only active volcanoes in India.
Therefore,due to volcanic activity in the past led the theory of the formation of Andman and Nicobar islands by volcanic eruption
Regards,