Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions