Question: Write in C language The size of an array in bytes depends on the number of elements it has, as well as each elements size.
Write in C language

The size of an array in bytes depends on the number of elements it has, as well as each elements size. Element size depends on the data type of the array and your computer. To calculate the storage space required for an array, multiply the number of elements in the array by the element size. For example, a 500-element array of type float requires storage space of 500 x 4 = 2000 bytes. You can determine the storage space within a C program using C's sizeof() operator. sizeof() is considered to be a unary operator, not a function. It takes as its argument a variable name or the name of the data type and returns the size, in bytes, of its argument. Please code the following, which illustrates sizeof(). const int SIZE = 100; int intarray[SIZE]; printf(" Size of int = $zu bytes", sizeof(int)); printf(" Size of intarray = $zu bytes", sizeof (intarray)); 1. Add code to print the size of the additional data types: short, long, float, double. The code and output should be in ascending order of size. 2. Declare two more arrays using the SIZE constant. These arrays will be of type float and double. 3. Add code to print the size of the arrays. As above, the code and output should be in ascending order of size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
