How are igneous rocks formed?

a) Compaction and cementation of sediments.

b) Cooling and solidification of magma.

c) Weathering of rocks.

d) Application of pressure and heat to sedimentary rocks.