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
Explain how can I remove the trailing spaces from a string?
can we implement multi-threads in c.
What does static variable mean in c?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Tell us bitwise shift operators?
What are the preprocessor categories?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is #include cctype?
What is c system32 taskhostw exe?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
What is function what are the types of function?
What does char * * argv mean in c?
Explain how does flowchart help in writing a program?
What does c value mean?
What are the rules for the identifier?