Question: Q2 ) File TEST.DAT contains only the FOLLOWING CHARACTERS: (with C language) 1 3 R E EOF TEC 21 DATA STRUCTU Show the letter of
Q2 ) File TEST.DAT contains only the FOLLOWING CHARACTERS: (with C language)

1 3 R E EOF TEC 21 DATA STRUCTU Show the letter of the alphabet that the ch indicates after executing the given instructions. FILE *fp; char ch; fp = fopen("TEST.DAT","rb+"); fseek(fp,-2,SEEK_END); ch = getc(fp); printf(" \t %c",ch); fseek(fp,-5, SEEK_CUR); ch = gete(fp); printf(" \t%c",ch); ch = getcifp); printf(" \t %c",ch); fseek(fp, OL, SEEK_SET); ch = getc(fp); printf(" \t %c",ch); fseek(fp, 6L, SEEK_CUR); ch = getc(fp); printf(" \t %c",ch); ch = getc(fp); printf(" \t %c",ch); fseek(fp,-2,SEEK_CUR); ch = getc(fp); printf(" \t %c",ch); fseek(fp,4L, SEEK_CUR); ch = getc(fp); printf(" \t %c",ch); fseek(fp,-1L,SEEK_CUR); ch = getc(fp); printf(" \t %c",ch); fclose(fp)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
