CS FundamentalsVery hardGATE CS (PYQ pattern)

A 3000-byte attachment is Base64-encoded for e-mail: every 3 bytes become 4 characters, and the encoded text is wrapped into lines of at most 76 characters, each line ending with CRLF (2 bytes). How many bytes does the encoded attachment occupy?

  1. A. 4000
  2. B. 4053
  3. C. 4106
  4. D. 4108

Correct answer: C. 4106

3000 bytes give 4000 characters; ceil(4000/76) = 53 lines; plus 53 x 2 = 106 bytes of CRLF: 4106 bytes.

More Computer Networks questions

Exams that ask this topic