#include #define MAXSTRING 100 int main(void){ char filename[MAXSTRING]; int c; FILE *ifp; fprintf(stderr, "\nInput a filename: "); scanf("%s", filename); ifp = fopen(filename, "r"); fseek(ifp, 0, SEEK_END); fseek(ifp, -1, SEEK_CUR); while (ftell(ifp) > 0) { c = getc(ifp); putchar(c); fseek(ifp, -2, SEEK_CUR); } /* The only character that has not been printed is the very first character in the file. */ fseek(ifp, 0, SEEK_SET); c = getc(ifp); putchar(c); return 0; }