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);
}
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 |
Tell me with an example the self-referential structure?
Is c is a procedural language?
What are type modifiers in c?
Can we declare function inside main?
What are different types of variables in c?
HOW CAN ADD OUR FUNCTION IN LIBRARY.
yogesh patil in dell
what is the difference between #include<stdio.h> and #include"stdio.h" ?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
0 Answers College School Exams Tests,
Taking an example,differentiate b/w loader and linker ?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
write a program without using main function?