Strictly speaking you can return only one variable from c function but that variable can be a pointer i.e. pointer to an array or pointer to a structure which can technically be used to return more then one value.
a and b are compared against the threshold ‘TH’, and the nearest value is voted as output
Please explain with an example