Question: QUESTION 5 In the following program, after Statement A is executed, the new address of ptr will be _________________ bytes more than the old address.

QUESTION 5

  1. In the following program, after Statement A is executed, the new address of ptr will be _________________ bytes more than the old address. (Assume that each int is stored in 4 bytes.)

    #include

    int one_d[] = {1,2,3};

    void main()

    {

    int *ptr;

    ptr = one_d;

    ptr +=3; /*Statement A*/

    printf(%d , *ptr); /Statement B */

    }

    A.

    12

    B.

    8

    C.

    3

    D.

    4

2 points

QUESTION 6

  1. In the code given for Q5 above, what will statement B print?

    A.

    3

    B.

    Garbage Value

    C.

    2

    D.

    1

2 points

QUESTION 7

  1. What will be the output of following statements?

    char *str= "Hello";

    char *ptr = str;

    printf("%c\t%c", 1[ptr], str[1]);

    A.

    Run time Error

    B.

    Garbage Value

    C.

    l l

    D.

    e e

2 points

QUESTION 8

  1. What will be the output of following code snippet?

    int k = 5;

    int *p = &k;

    int **m = &p;

    **m = 6;

    printf("%d ", k);

    A.

    5

    B.

    6

    C.

    Garbage Value

    D.

    Compile-time Error

2 points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!