# Answer to Question #24107 in C++ for Nourah

Question #24107

How much memory is set aside by the following commands? Show your work.

int nums[4];

double vals[5];

int nums[4];

double vals[5];

Expert's answer

As an int variable takes 2 bytes, then an array of 4 ints will take 8 bytes. So,

int nums[4];

sets 16 bytes of memory. Analogically, double variable usually takes 4 bytes, therefore

double vals[5];

sets 20 bytes.

int nums[4];

sets 16 bytes of memory. Analogically, double variable usually takes 4 bytes, therefore

double vals[5];

sets 20 bytes.

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment