C program(memory diagram with pointers)

What are the outputs of the following program. Explain with the help of the memory model as it was shown in the lecture. http://teg.uwasa.fi/courses/tlte2110/lectures/Lecture_4.pdf check page 11, 7,5 of the lecture note #include int main(void) { int array[] = {9,4,5,3,8,2,1,6}; int *ptr; int *qtr; int **pptr; int i = 0; ptr = array; qtr = &array[6]; printf(‘%dn’,*ptr – *qtr); // Output:__________________________________ ptr = ptr + 2; ptr[1] = *qtr; for(i = 0; i < 8; i++) printf('%d ', array[i]); // Output:________________________________________ printf('n'); pptr = &qtr; printf('%dn',**pptr); // Output:__________________________________ return 0; }

Looking for this or a Similar Assignment? Click below to Place your Order

Open chat