B
Below is a question with multiple-choice answers. Choose the correct option based on your reasoning.

### Question:
When a volcano erupts, lava flows out from the top. What type of rock is formed as the lava cools?

### Choices:
A. magma
B. igneous
C. sedimentary
D. metamorphic

### Answer:
