Diamonds are not formed by magma cooling so (a) is the correct choice.
Diamonds are considered a precious stone, they are a crystalline form of carbon and they are the hardest substance on the Moh scale of mineral hardness.
Diamonds are brought to the earth's surface by volcanic eruptions but they aren't formed at the time magma cools. Rather, they are formed in the earth's mantle at very high temperature and pressure, mostly beneath the interiors of continental plates. Diamonds that formed in these zones are thought to have been rapidly carried to the surface during deep source volcanic eruptions.
Diamonds have also been found in rocks that formed in subduction zones and as nanoparticles in meteorites.
A diamond's hardness is due to covalent network bonding. Carbon atoms in diamond are in a strongly bonded crystal structure is which each carbon atom shares electrons with four other carbon atoms, forming what is called "giant covalent structures."