Computer Science, asked by russell1234, 5 months ago

Pls help me it's urgent

Attachments:

Answers

Answered by nimmi1411
1

Answer :

a) 20 bytes. b)12 bytes. c) 12 bytes

Explanation:

all the three given subparts are representing String type values .

Since a character type value requires 2 bytes memory , we can calculate the number of characters present in the given String value to find the memory capacity needed for them .

In a) ....the word 'incredible' has 10 characters .

if one character occupies 2 bytes ,,,

then 10 characters will occupy 10 x 2 = 20 bytes .

Similarly for b) and c) parts .

In b) ...'\n' is an escape sequence ....which is a non graphic character only ....Hence it will occupy one character's storage oy that is 2 bytes .

Except '\n' ...there are 5 Characters left ....so memory occupied .....(5 x 2)+ 2 = 12 bytes .

In c) ....'+' is also a character ....so total there are 6 characters ....memory occupied is 6 x 2 = 12 bytes .

Similar questions