Why did viking 1 and 2 get sent to mars?

The Viking 1 and Viking 2 were sent to Mars to study the surface of Mars.