Question: Q 4 Write a program that does the following: i ) Declares and initializes three arrays as follows: int arr ] = { 0 ,

Q4 Write a program that does the following: i) Declares and initializes three arrays as follows: int arr]={0,1,2}; double darr[]={1.0,2.0,3.0}; char carr[]={'1','2','3'}; ii) Prints the address of the array and each of the three elements for each of the three different kinds of arrays (arr, &arr[0]), &arr[1]), &arr[2]), darr, &darr[0]), &darr[1]), &darr[2]), carr, &carr[0]), &carr[1]), &carr[2])) iii) Prints an output in the following format:Address of the, integer array: 0060FF04 Address of the first element : 0060FF04 Address of the second element 0060FF08 Address of the third element 0060FF0C The address of the int array is the same as the address of the first element. Address of the double array: 0060FEE8 Address of the first element : 0060FEE8 Address. of the second element : 0060FEFO Address of the third element : 0060FEF8 The address of the double array is the same as the address of the first element: Address of the char array: 0060FEE5 Address of the first element : 0060FEES Address of the second element : 0060FEE6 Address of the third element : 0060FEE7 The address of the char array is the same as the address of the first element

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!