Correct option is B
When someone says "We came to say hello as we were passing through," it means that the person stopped by to greet someone they know as they were passing through a particular place.
The collocation "say hello" is commonly used to describe the act of greeting someone, especially in informal settings.
Option (b) is the correct answer.