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

which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1412


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1587


What is the use of sizeof?

550


Why is c fast?

601


What are the advantages of using linked list for tree construction?

639






What is the significance of scope resolution operator?

851


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1654


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

613


What is const volatile variable in c?

572


What are c header files?

573


How can I read a binary data file properly?

631


Explain what is the heap?

618


What is the hardest programming language?

661


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1462


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

575