In the following program, if the first printf() statement prints 0x0256, what will be the output of the second printf() statement? 1: #include 2: 3: int main(void) 4: { 5: int i, array[5]; 6: 7: for (i = 0; i < 5; i++) 8: array[i] = i * 11; 9: 10: printf("%p\n", array); 11: printf("%d\n", (*array) + 2); 12: 13: return 0; 14: }

Respuesta :

Answer:

Output will be: 2

Explanation:

#include <stdio.h>

#include <iostream>

using namespace std;

int main()

{

   int i, array[5];

   for (i = 0; i < 5; i++)

       array[i] = i * 11;

   printf("%p\n", array);      // it will print base address(memory address) of machine where array is stored

   printf("%d\n", (*array) + 2); // it will print value at base address i.e. 0 in this case and add 2 in it

   // then prints it.

   return 0;

}

Ver imagen dayanandghelaro