Sizes of Constants: ‘\a’, “\a”, “Reema\’s”, ‘\”’

Q5. What will be the sizes of following constants: ‘\a’, “\a”, “Reema\’s”, ‘\”’ ?

Ans. ‘\a’. Size is 1 as there is 1 character (escape sequence) and it is character constant (enclosed in single quotes)

“\a”. Size is 2 as there is 1character and the terminator because it is a string (enclosed in double quotes)

“Reema\’s”. Size is 8 because it is a string having 7 characters enclosed in double quotes’\”’. Size is 1. It is a character constant and is containing just one character \”.

Leave a Reply

Your email address will not be published. Required fields are marked *