#include <stdio.h> #include <process.h> int main() { char ch, filename[85]; FILE *fileptr; long lastpos; printf(”Anna tiedoston nimi\”); gets(filename); if ((fileptr = fopen(filename, ”r”)) == NULL) { printf(”Tiedostoa ei voi avata”); exit (0); } fseek(fileptr, 0, SEEK_END); lastpos = ftell(fileptr); while(!feof(fileptr)) { fseek(fileptr, --lastpos, SEEK_SET); ch = fgetc(fileptr); putchar(ch); } fclose(fileptr); return 0; }