1st of all, I don't speak Fortran, so it can be that I misunderstand your question!
In regular C, the printf formating would be:
- printf("The temp is %6.2f\n",temp) to have 4 digit before the decimal point and 2 digit after.
- printf("The temp is %6.4f\n",temp) to have 2 digit before the decimal point and 4 digit after.
See for example: Kernighan & Ritchie, The C programming language (2nd edition), page 13.
Regards