Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    #define prod(a,b) a*b

    void main()

    {

    int x=3, y=4;

    printf("%d", prod(x+2, y-1));

    }

  2. A.

     15

    B.

     10

    C.

     12

    D.

     11

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The macro expands and evaluates to as:
    x+2*y-1 => x+(2*y)-1 => 10


Be The First To Comment