T thanhthao New member Sep 19, 2021 #1 What is the size of ans variable after the following code? Code: sprintf('23 23') ans= ’23 23’ A. 14 bytes B. 10 bytes C. Error D. 1*5
What is the size of ans variable after the following code? Code: sprintf('23 23') ans= ’23 23’ A. 14 bytes B. 10 bytes C. Error D. 1*5
V Vy Bùi New member Sep 19, 2021 #2 Answer: b Explanation: The number of elements in the character array, given as input are 5. They are ‘2’, ‘3’, ‘ ’, ‘2’, ‘3’. Hence, the total size will be 10 bytes as each element will take 2 bytes. The ‘’ are not taken as elements. Upvote 0 Downvote
Answer: b Explanation: The number of elements in the character array, given as input are 5. They are ‘2’, ‘3’, ‘ ’, ‘2’, ‘3’. Hence, the total size will be 10 bytes as each element will take 2 bytes. The ‘’ are not taken as elements.