C Operators Questions and Answers
Practice ModeShowing 10 of 122 questions
Q31
Find the output
void main ( )
{
int x=10, y=5, p, q;
p=x>9;
q=p ||(x=5, y=10);
printf("%d %d %d", q,x,y);
}
Answer: Option A
Q32
Find the output
void main( )
{
int x=-2;
x=-x-x+x;
printf("%d", x);
}
Answer: Option B
Q33
Masking is a technique
Answer: Option C
Q34
Find the output
void main ( )
{
int a, b, c;
a=1, b=2, c=3;
a=a?b:c;
c=-b?a:c;
printf("%d %d", a, c);
}
Answer: Option C
Q35
Find the output.
void main ( )
{
int x=2, y=1;
y+=x<<=2;
printf(%d %d", x,y);
}
Answer: Option D
Q36
Find the output.
void main ( )
{
int x=-5u;
int y=5;
y=y>x?y/x:x/y;
printf("%u",y);
}
Answer: Option C
Q37
Find the output.
void main ( )
{
int a,b, sum=0;
sum=(a=5,b=9, ++a+ ++b);
printf("%d", sum);
Answer: Option A
Q38
b++ executes faster than b+1 because
Answer: Option B
Q39
Find the output
void main ( )
{
int x,y,z;
z=(x=3) && (y=7) &10;
printf ("%d", z);
Answer: Option B
Q40
Find the output.
void main ( )
{
int x,y,z;
x=2; y=4;
z=y++*x++ | y--;
printf("%d", z);
}
Answer: Option D