What will be the output of the program if the array begins at address 65486?
#include<stdio.h>
void main()
{
int arr[] = {12, 14, 15, 23, 45};
printf("%u, %u", arr, &arr);
}
#include<stdio.h>
void main()
{
int arr[] = {12, 14, 15, 23, 45};
printf("%u, %u", arr, &arr);
}
A. 65486, 65488
B. 65486, 65490
C. 65486, 65487
D. 65486, 65486
E. None of these
Answer: Option D
Solution(By Examveda Team)
>> int arr[] = {12, 14, 15, 23, 45}; The variable arr is declared as an integer array and initialized.
>> printf("%u, %u", arr, &arr); Here,
The base address of the array is 65486.
=> arr, &arr is pointing to the base address of the array arr.
Hence the output of the program is 65486, 65486.
Join The Discussion
Comments ( 1 )
Related Questions on Arrays and Strings
what is &arr means??