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 different types of variables in c?
Explain what are multidimensional arrays?
how to count no of words,characters,lines in a paragraph.
What are 'near' and 'far' pointers?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Can we increase size of array in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
can anyone please tell about the nested interrupts?
What is the significance of scope resolution operator?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Is c procedural or object oriented?
write a program to concatenation the string using switch case?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
can any one provide me the notes of data structure for ignou cs-62 paper