IBM MQ provides a command dspmqver which will display required details along with the IBM Mq version . But if you want to just display IBM MQ version without other details like installation path installation name binary path etc then use below command
$ dspmqver -f2
Version: 9.2.0.0