If I understand you right, you need to change this:
if ( a > b ) return printf( "%d > %d and total now is %d\n", a, b, total ), a;
To this:
if ( a > b )
{
total++;
return printf( "%d > %d and total now is %d\n", a, b, total );
}
And this:
int total = 1;
To this:
static int total = 1;
[edit]Just noticed the end of line rubbish in your code...[/edit]