Home / General Knowledge / Testing sawaal :: Discussion

Discussion :: Testing sawaal

  1. What will be output when you will execute following c code?

    #include <stdio.h>
    void main()

    {
        signed int a = -1;
        unsigned int b = -1u;
        if(a == b)
             printf( "The Lord of the Rings" );
        else
             printf( "American Beauty" );
    }

  2. A.
    The Lord of the Rings
    B.
    American Beauty
    C.
    Compilation error: Cannot compare signed number with unsigned number
    D.
    Warning: Illegal operation

    View Answer

    Workspace

    Answer : Option A

    Explanation :



Be The First To Comment