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
What is getch () for?
Apart from dennis ritchie who the other person who contributed in design of c language.
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What is the difference between constant pointer and constant variable?
Explain what standard functions are available to manipulate strings?
What are preprocessor directives?
What is wild pointer in c?
Explain the bubble sort algorithm.
In a header file whether functions are declared or defined?
Explain the difference between exit() and _exit() function?
what are bit fields in c?
What is #include stdio h?
Write a program to print ASCII code for a given digit.
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is the difference between far and near ?