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 are 3 types of structures?
What functions are used for dynamic memory allocation in c language?
Are the variables argc and argv are local to main?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
Do you know the purpose of 'register' keyword?
What is the purpose of the statement: strcat (S2, S1)?
Which is better pointer or array?
Explain how can you be sure that a program follows the ansi c standard?
What is new line escape sequence?
Are local variables initialized to zero by default in c?
i have a written test for microland please give me test pattern
What is quick sort in c?
Why is python slower than c?
Explain what is the heap?
Can you write a programmer for FACTORIAL using recursion?