Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1

* / % + - =
= * / % + -
/ * % - + =
* % / - + =
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=-3, j=2, k=0, m;
    m = ++i && ++j && ++k;
    printf("%d, %d, %d, %d", i, j, k, m);
    return 0;
}

-2, 3, 1, 1
2, 3, 1, 2
1, 2, 3, 1
3, 3, 1, 2
Associativity has no role to play unless the precedence of operator is same.

True
False
Are the following two statement same?
1. a <= 20 ? b = 30: c = 30;
2. (a <=20) ? b : c = 30;

Yes
No
Which of the following correctly shows the hierarchy of arithmetic operations in C?

/ + * -
* - / +
+ - / *
/ * + -
Assunming, integer is 2 byte, What will be the output of the program?
#include<stdio.h>

int main()
{
    printf("%x", -2<<2);
    return 0;
}

ffff
0
fff8
Error
The expression of the right hand side of || operators doesn't get evaluated if the left hand side determines the outcome.

True
False
Two different operators would always have different Associativity.

Yes
No
Which of the following is the correct usage of conditional operators used in C?

a>b ? c=30 : c=40;
a>b ? c=30;
max = a>b ? a>c?a:c:b>c?b:c
return (a>b)?(a:b)
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=-3, j=2, k=0, m;
    m = ++i || ++j && ++k;
    printf("%d, %d, %d, %d", i, j, k, m);
    return 0;
}

2, 2, 0, 1
1, 2, 1, 0
-2, 2, 0, 0
-2, 2, 0, 1
In the expression a=b=5 the order of Assignment is NOT decided by Associativity of operators

True
False
Will the expression *p = p be disallowed by the compiler?

Yes
No
Which of the following is the correct order if calling functions in the below code?
a = f1(23, 14) * f2(12/4) + f3();

f1, f2, f3
f3, f2, f1
Order may vary from compiler to compiler
None of above
What will be the output of the program?
#include<stdio.h>
int main()
{
    int x=12, y=7, z;
    z = x!=4 || y == 2;
    printf("z=%d", z);
    return 0;
}

z=0
z=1
z=4
z=2
Associativity of an operator is either Left to Right or Right to Left.

True
False
Every operator has an Associativity

Yes
No
Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&

1, 2
1, 3
2, 4
1, 2, 3
What will be the output of the program?
#include<stdio.h>
int main()
{
    static int a[20];
    int i = 0;
    a[i] = i  ;
    printf("%d, %d, %d", a[0], a[1], i);
    return 0;
}

1, 0, 1
1, 1, 1
0, 0, 0
0, 1, 0
In which order do the following gets evaluated
1. Relational
2. Arithmetic
3. Logical
4. Assignment

2134
1234
4321
3214
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=4, j=-1, k=0, w, x, y, z;
    w = i || j || k;
    x = i && j && k;
    y = i || j &&k;
    z = i && j || k;
    printf("%d, %d, %d, %d", w, x, y, z);
    return 0;
}

1, 1, 1, 1
1, 1, 0, 1
1, 0, 0, 1
1, 0, 1, 1
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=-3, j=2, k=0, m;
    m = ++i && ++j || ++k;
    printf("%d, %d, %d, %d", i, j, k, m);
    return 0;
}

1, 2, 0, 1
-3, 2, 0, 1
-2, 3, 0, 1
2, 3, 1, 1
What will be the output of the program?
#include<stdio.h>
int main()
{
    int x=4, y, z;
    y = --x;
    z = x--;
    printf("%d, %d, %d", x, y, z);
    return 0;
}

4, 3, 3
4, 3, 2
3, 3, 2
2, 3, 3
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=3;
    i = i++;
    printf("%d", i);
    return 0;
}

3
4
5
6
What will be the output of the program?
#include<stdio.h>
int main()
{
    int a=100, b=200, c;
    c = (a == 100 || b > 200);
    printf("c=%d", c);
    return 0;
}

c=100
c=200
c=1
c=300
What will be the output of the program?
#include<stdio.h>
int main()
{
    int x=55;
    printf("%d, %d, %d", x<=55, x=40, x>=10);
    return 0;
}

1, 40, 1
1, 55, 1
1, 55, 0
1, 1, 1
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=2;
    printf("%d, %d", ++i, ++i);
    return 0;
}

3, 4
4, 3
4, 4
Output may vary from compiler to compiler
What will be the output of the program?
#include<stdio.h>
int main()
{
    int k, num=30;
    k = (num>5 ? (num <=10 ? 100 : 200): 500);
    printf("%d", num);
    return 0;
}

200
30
100
500
What will be the output of the program?
#include<stdio.h>
int main()
{
    char ch;
    ch = 'A';
    printf("The letter is");
    printf("%c", ch >= 'A' && ch <= 'Z' ? ch + 'a' - 'A':ch);
    printf("Now the letter is");
    printf("%c", ch >= 'A' && ch <= 'Z' ? ch : ch + 'a' - 'A');
    return 0;
}

The letter is a
Now the letter is A
The letter is A
Now the letter is a
Error
None of above
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=2;
    int j = i + (1, 2, 3, 4, 5);
    printf("%d", j);
    return 0;
}

4
7
6
5