main()
{
FILE *fs;
char c[10];
fs = fopen(“source.txt”, ”r”); /* source.txt exists and
contains “Vector Institute” */
fseek(fs,0,SEEK_END);
fseek(fs,-3L,SEEK_CUR);
fgets(c,5,fs);
puts(c);
}

Answer Posted / sahoo845

it prints ute.
SEEK_END moves the pointer to end of the file.
SEEK_CUR moves the pointer 3 places back(-3L). Nw the pointer is at u.
gets() tries to fetch 5 characters from the present position of pointer but can fetch only 3 characters as it reaches end of file.
puts() prints the characters i.e. ute.

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are preprocessor directives?

614


What is I ++ in c programming?

609


What are the functions to open and close the file in c language?

582


What does 3 periods mean in texting?

587


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1506






What is this infamous null pointer, anyway?

599


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

620


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1718


how is the examination pattern?

1585


what do you mean by inline function in C?

605


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

5167


what are the different storage classes in c?

652


How can I get back to the interactive keyboard if stdin is redirected?

659


How many types of operator or there in c?

591


shorting algorithmS

1789