3 questions in the discription below

profileIwantana

1.      Consider the following syntax of a program.

 

    int i, j = 26;

    int *pi, *pj = &j;

    *pj = j + 5;

    i = *pj + 5;

    pi = pj;

    *pi = i + j;

 

Solve the problem by finding and explaining the following:

(1)               &i                   

(2)               &j

(3)               pi

(4)               pj

(5)               *pi

(6)               *pj

(7)               i

(8)               pi

(9)               *(pi-1)

(10)           (*pi+2)

(11)           (pi+2)

(12)            

 

2.      Write a C program using a pointer for keying six integers by the user. The six values are stored in an array using a pointer.  Then print the elements of the array on the screen.  

 

3.      Modify the solution of exercise 2 using a pointer to make the C program to print the elements of the array in reverse order. 

    • 11 years ago
    • 20
    Answer(2)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      pointer_assignment.docx

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      pointer-assignment.rar
    Bids(0)