Home / General Knowledge / Testing New :: Discussion

Discussion :: Testing New

  1. Determine Output:

    void main()

    {

    int i;

    char a[]="�";

    if(printf("%sn", a))

    printf("Ok here n");

    else

    printf("Forget itn");

    }

  2. A.

     Ok here

    B.

     Forget it

    C.

     Error

    D.

     None of These

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Printf will return how many characters does it print. Hence printing a null character returns 1 which makes the if statement true, thus "Ok here" is printed.


Be The First To Comment