function in C that takes three parameters