Which of the following rocks is produced by the solidification of magma within the earth…