Home / General Knowledge / Testing New :: C Fundamentals MCQs

General Knowledge :: Testing New

  1. Determine Output:

    void main()

    {

    char s[]="man";

    int i;

    for(i=0; s[i]; i++)

    printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]);

    }

  2. A.

     mmm nnn aaa

    B.

     mmmm nnnn aaaa

    C.

     Compiler Error

    D.

     None of These


  3. Determine Output:

    void main()

    {

    float me = 1.1;

    double you = 1.1;

    if(me==you)

    printf("I hate Examveda");

    else

    printf("I love Examveda");

    }

  4. A.

     I hate Examveda

    B.

     I love Examveda

    C.

     Error

    D.

     None of These


  5. Determine Output:

    void main()

    {

    static int var = 5;

    printf("%d ", var--);

    if(var)

    main();

    }

  6. A.

     5 5 5 5 5

    B.

     5 4 3 2 1

    C.

     Infinite Loop

    D.

     None of These


  7. Determine Output:

    void main()

    {

    char *p;

    printf("%d %d", sizeof(*p), sizeof(p));

    }

  8. A.

     1 1

    B.

     1 2

    C.

     2 1

    D.

     2 2


  9. Determine the Final Output:

    void main()

    {

    printf("\nab");

    printf("\bsi");

    printf("\rha");

    }

  10. A.

     absiha

    B.

     asiha

    C.

     haasi

    D.

     hai


  11. Determine Output:

    void main()

    {

    int i=10;

    i=!i>14;

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

    }

  12. A.

     10

    B.

     14

    C.

     0

    D.

     1


  13. Determine Output:

    void main()

    {

    int c = - -2;

    printf("c=%d", c);

    }

  14. A.

     1

    B.

     -2

    C.

     2

    D.

     Error


  15. Determine Output:

    #define int char

    void main()

    {

    int i = 65;

    printf("sizeof(i)=%d", sizeof(i));

    }

  16. A.

     sizeof(i)=2

    B.

     sizeof(i)=1

    C.

     Compiler Error

    D.

     None of These


  17. Determine Output:

    void main()

    {

    int i=3;

    switch(i)

    {

    default: printf("zero");

    case 1: printf("one"); break;

    case 2: printf("two"); break;

    case 3: printf("three"); break;

    }

    }

  18. A.

     zero

    B.

     three

    C.

     Error

    D.

     None of These


  19. Determine Output:

    void main()

    {

    char string[]="Hello World";

    display(string);

    }

    void display(char *string)

    {

    printf("%s", string);

    }

  20. A.

     will print Hello World

    B.

     Compiler Error

    C.

     Can't Say

    D.

     None of These