Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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);
}



main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and ..

Answer / 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

More C Interview Questions

Is it possible to execute code even after the program exits the main() function?

0 Answers  


Write a program using two-dimensional array that lists the odd numbers and even numbers separately in a 12 input values.

1 Answers  


What is the difference between fread and fwrite function?

0 Answers  


Explain how do you print only part of a string?

0 Answers  


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


What is indirection?

0 Answers  


Write the Program to reverse a string using pointers.

0 Answers   InterGraph,


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

0 Answers  


Do you know null pointer?

0 Answers  


Explain heap and queue.

0 Answers   Aricent,


Why clrscr is used in c?

0 Answers  


What is meant by global static? why we have to use static variable instead of Global variable

4 Answers   L&T,


Categories