Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program if the array begins 1200 in memory? #include<stdio.h> int main() { int arr[]={2, 3, 4, 1, 6}; printf("%u, %u, %u\n", arr, &arr[0], &arr); return 0; } ?->(Show Answer!)
1. What will be the output of the program if the array begins 1200 in memory? #include<stdio.h> int main() { int arr[]={2, 3, 4, 1, 6}; printf("%u, %u, %u\n", arr, &arr[0], &arr); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.00 pm
Step 1: int arr[]={2, 3, 4, 1, 6}; The variable arr is declared as an integer array and initialized. Step 2: printf("%u, %u, %u\n", arr, &arr[0], &arr); Here, The base address of the array is 1200. => arr, &arr is pointing to the base address of the array arr. => &arr[0] is pointing to the address of the first element array arr. (ie. base address) Hence the output of the program is 1200, 1200, 1200