>> char car;
>> car = getc(stdin);
getc() returns an int, not a char. You compiler should be warning you of such errors, if it isn't, turning up the warning levels!

The displayval() functions returns an arbituary value (ie always 0). There's no point in returning a hardcoded value in this way, I'd suggest you either return nothing (change to void function), or return the value from the printf() function.


[edit]
Out of interest, can you post the source for the fpurge() function.