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

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


Please Help Members By Posting Answers For Below Questions

What are 3 types of structures?

1065


What functions are used for dynamic memory allocation in c language?

1151


Are the variables argc and argv are local to main?

1317


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1247


Do you know the purpose of 'register' keyword?

1019


What is the purpose of the statement: strcat (S2, S1)?

1165


Which is better pointer or array?

1026


Explain how can you be sure that a program follows the ansi c standard?

1475


What is new line escape sequence?

1344


Are local variables initialized to zero by default in c?

1051


i have a written test for microland please give me test pattern

2730


What is quick sort in c?

1086


Why is python slower than c?

1086


Explain what is the heap?

1058


Can you write a programmer for FACTORIAL using recursion?

1041