adplus-dvertising
frame-decoration

Question

Assuming a short is two bytes long, what will be printed by the below code?
short testarray[4][3] = { {1}, {2,3}, {4,5,6}};
printf("%d", sizeof(testarray));

a.

6

b.

7

c.

24

d.

It will not compile because not enough initializers are given

Posted under C Programming

Answer: (c).24

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Assuming a short is two bytes long, what will be printed by the below code?
xyz : June 26, 2023

Assuming a short is two bytes long, what will be printed by the below code?
short testarray[4][3] = { {1}, {2,3}, {4,5,6}};
printf("%d", sizeof(testarray));
explain the answer of the question pls