Top

Expressions

11.

What is the output of this C code?  

int main()
    {
        int a = 10;
        if (a == a--)
            printf("TRUE 1\t");
        a = 10;
        if (a == --a)
            printf("TRUE 2\t");
    }

 

Answer: C

No answer description available for this question.

Enter details here

12.

What is the output of this C code?    

int main()
    {
        int i = 1;
        if (i++ && (i == 1))
            printf("Yes\n");
        else
            printf("No\n");
    }

 

Answer: B

No answer description available for this question.

Enter details here

13.

A function cannot be defined inside another function

Answer: A

A function cannot be defined inside the another function, but a function can be called inside a another function.

Enter details here

14.

What is the output of this C code?    

int main()
    {
        int x = 1, y = 0, z = 3;
        x > y ? printf("%d", z) : return z;
    }

 

Answer: C

No answer description available for this question.

Enter details here

15.

What is the output of this C code?    

void main()
    {
        int x = 97;
        int y = sizeof(x++);
        printf("x is %d", x);
    }

 

Answer: A

No answer description available for this question.

Enter details here

16.

What is the output of this C code?    

void main()
    {
        int a = -5;
        int k = (a++, ++a);
        printf("%d\n", k);
    }

 

Answer: D

No answer description available for this question.

Enter details here

17.

What will be the output of the following program?

#include< stdio>

void fun()
{
fun();
Return 0;
}
void fun()
{
auto int I = 1;
register char a = ‘D’;
static int p = 0;
printf(“%d %d %ld”, I, a, p);
}

 

Answer: D

No answer description available for this question.

Enter details here

18.

What is the output of this C code?

int main()
    {
        int i = 5;
        int l = i / -4;
        int k = i % -4;
        printf("%d %d\n", l, k);
        return 0;
    }

 

Answer: B

No answer description available for this question.

Enter details here

19.

What is the output of this C code?

int main()
    {
        int i = 2;
        int j = ++i + i;
        printf("%d\n", j);
    }

 

Answer: A

No answer description available for this question.

Enter details here

20.

What is the output of this C code?

void main()
    {
        int y = 3;
        int x = 7 % 4 * 3 / 2;
        printf("Value of x is %d", x);
    }

 

Answer: A

No answer description available for this question.

Enter details here

Loading…
Tags: Expressions Questions and Answers || Expressions MCQ Questions and Answers || Expressions GK Questions and Answers || Expressions GK MCQ Questions || Expressions Multiple Choice Questions and Answers || Expressions GK || GK on Expressions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming