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 what are preprocessor directives?
What is I ++ in c programming?
What are the functions to open and close the file in c language?
What does 3 periods mean in texting?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What is this infamous null pointer, anyway?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
how is the examination pattern?
what do you mean by inline function in C?
#include
what are the different storage classes in c?
How can I get back to the interactive keyboard if stdin is redirected?
How many types of operator or there in c?
shorting algorithmS