Wednesday, 10 December 2014

Programming Quiz-14

Q: What is the output of this C code?

#include <stdio.h>

int main()

{

    int a = 10;

    if (a == a--)

        printf("TRUE 1\t");

    a = 10;

    if (a == --a)

        printf("TRUE 2\t");

}

Options:

a) TRUE 1
b) TRUE 2
c) TRUE 1 TRUE 2
d) No output

Answer: A

No comments:

Post a Comment