#include /* C example */ #include #include /* for isprint */ #include /* for frexp */ void print_int(int i); /* function declaration */ void print_char(char c); void print_double(double d); int main() { int i = 65; char c = 'A'; double d = 65.0; print_int(i); print_char(c); print_double(d); return EXIT_SUCCESS; } void print_int(int i) /* function definition */ { printf("%d\n", i); } void print_char(char c) { /* Output the character code of c as a non-negative decimal integer. */ printf("%u", (unsigned char)c); /* cast to avoid sign extension */ if (isprint((unsigned char)c)) { printf("\t'%c'", c); } printf("\n"); } void print_double(double d) { int exponent; double mantissa = frexp(d, &exponent); printf("%g, mantissa == %g, exponent == %d\n", d, mantissa, exponent); }