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 is meant by type casting?
What is the use of sizeof?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
How do you define CONSTANT in C?
What is the difference between variable declaration and variable definition in c?
Why isnt any of this standardized in c?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
Why do we use c for the speed of light?
What is include directive in c?
Explain what is dynamic data structure?
Is python a c language?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Can main () be called recursively?