Something like below?
I rewrote it and used other names for the variables.



#include <stdio.h>

int calcRows( int cols, int maxVal );

int main( )