Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    void main()

    {

    char a[]="12345";

    int i = strlen(a);

    printf("%d", ++i);

    }

  2. A.

     5

    B.

     6

    C.

     7

    D.

     None of These

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The char array 'a' will hold the initialized string, whose length will be counted from 0 till the null character. Hence the 'i' will hold the value equal to 5, after the pre-increment in the printf statement, then 6 will be printed.


Be The First To Comment