Tuesday 4 July 2017



               
1.In a file contains the line "I am a boy\r\n" then on reading this line into the array str using fgets(). What will str contain?
A.            "I am a boy\r\n\0"
B.            "I am a boy\r\0"
C.            "I am a boy\n\0"
D.            "I am a boy"
TRY  IT YOURSELF


Answer: Option C
Explanation:
Declaration: char *fgets(char *s, int n, FILE *stream);
fgets reads characters from stream into the string s. It stops when it reads either n - 1 characters or a newline character, whichever comes first.

Therefore the  string str  contain “ I am a boy\n\0”.

3 comments:

  1. good question

    ReplyDelete
  2. Here is Mr Benjamin contact Email details, 247officedept@gmail.com. /  Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Mr Benjamin put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.

    ReplyDelete