Question

How many elements of type int can be stored in an array occupying 99 bytes of...

How many elements of type int can be stored in an array occupying 99 bytes of memory?

What is the memory address of the element with index 16 in an array of type unsigned short int if the address of the first element of the array is 26,449?

Homework Answers

Answer #1

Answer:

Part 1:

One element of type int is of 4 bytes.

Therefore 99 bytes will be able to store 24 element of type int (because 99/4=24.75).

Part 2:

The memory address of the element with index 16 will be 26,481.

One element of unsigned short int is of 2 bytes.Therefore for every index memory will get increamented by two times as shown in the table below.

INDEX

MEMORY ADDRESS

0

26,449

1

26,451

2

26,453

3

26,455

4

26,457

5

26,459

6

26,461

7

26,463

8

26,465

9

26,467

10

26,469

11

26,471

12

26,473

13

26,475

14

26,477

15

26,479

16

26,481

Note--

Please upvote if you like the effort.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
declare an array of type unsigned int called values with five elements and initialize the elements...
declare an array of type unsigned int called values with five elements and initialize the elements to the even integers from 2 to 10. Assume that the symbolic constant SIZE has been defined as 5
In Java: The maximum-valued element of an int-valued array can be recursively calculated as follows: •...
In Java: The maximum-valued element of an int-valued array can be recursively calculated as follows: • If the array has a single element, that is its maximum (note that a zero-sized array has no maximum • Otherwise, compare the first element with the maximum of the rest of the array-- whichever is larger is the maximum value. Write an int method named max that accepts an int array, and the number of elements in the array and returns the largest...
1a) A memory unit has 28-bit address lines and 64-bit input/output data lines. How many bytes...
1a) A memory unit has 28-bit address lines and 64-bit input/output data lines. How many bytes of data can this memory hold? How many words does it contain, and how large is each word? b) A memory unit consists of 32M words of 16-bit each. How many bits wide address lines and input-output data lines are needed to access this memory? c) A memory unit consists of 512K bytes of data. How many bits wide address lines are needed to...
10. Number Array Class Design a class that has an array of floating-point numbers. The constructor...
10. Number Array Class Design a class that has an array of floating-point numbers. The constructor should accept an integer argument and dynamically allocate the array to hold that many numbers. The private data members of the class should include the integer argument in a variable to hold the size of the array and a pointer to float type to hold the address of the first element in the array. The destructor should free the memory held by the array....
Given a large array of several million elements of type 'double', you are asked to sort...
Given a large array of several million elements of type 'double', you are asked to sort them in ascending order using an algorithm of your choice. You choose selection sort. Why is this a poor choice? Group of answer choices Selection sort can only sort elements of type 'int' Selection sort requires 3x the memory of other sort algorithms Selection sort can only work on an array with an odd number of elements Selection sort will be prohibitively inefficient for...
Prelab: Week of September 9th You’ve created a general-purpose function for allocating an array with elements...
Prelab: Week of September 9th You’ve created a general-purpose function for allocating an array with elements of any data type: array = createArray(numElems, elemSize); Now we want to generalize the function so that the result secretly stores the size (number of elements) with the array so that we can implement the following function size = getArraySize(array); which allows the user to determine the number of elements in a given array whenever its needed. You’ll want to declare the parameter to...
1. In the following C code, elements of each row are stored contiguously in memory. Assume...
1. In the following C code, elements of each row are stored contiguously in memory. Assume each element in an array is a 32-bit integer. p = 0; for (j=0; j<8; ++j) for(i=500; i>0; --i ) {     A[ i] = 2 * B[j]; ++p; } a. How many 32-bit integers can be stored in a 32-byte cache block? b. Which variable references exhibit temporal locality? c. Which variable references exhibit spatial locality?
Use MATLAB to determine how many elements are in the array sin(-pi/2):0.05:cos(0). Use MATLAB to determine...
Use MATLAB to determine how many elements are in the array sin(-pi/2):0.05:cos(0). Use MATLAB to determine the 10th element.
1. An array has an index of [5] at the starting address of 200. It has...
1. An array has an index of [5] at the starting address of 200. It has 3 words per memory cell, determine loc[3],loc[4] and NE. (3 Marks: 1 mark for each) 2. A 2-D array defined as A[10 , 5] requires 4 words of storage space for each element. Calculate the address of A[4,3] given the base address as 250 • If the array is stored in Row-major form • If the array is stored in Column-major form 3. Write...
From a set of n elements, how many subsets with at least 5 element can be...
From a set of n elements, how many subsets with at least 5 element can be formed?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT