Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: Bitwise Operators

Home > C Programming > Bitwise Operators > General Questions

1. What is the output of the following 'C' program ?

#include
void main()
{
printf("%x",-1<<4);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

"-1 is internally represented as all 1's. When left shifted four times the least" significant 4 bits are filled with 0's.
The %x format specifier specifies that the integer value be printed as a hexadecimal value.

Workspace

Tags:

No Tags on this question yet!

2. What is the output of the following 'C' program ?

#include
int main() {
int i=10;
i=!i>14;
printf("i=%d",i);
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

In the expression !i>14 , NOT (!) operator has more precedence than ">"

symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero).

Workspace

Tags:

No Tags on this question yet!

3. What is the output of the following 'C' program ?

#include
void main()
{
int i =0;j=0;
if(i && j++)
printf("%d..%d",i++,j);
printf("%d..%d,i,j);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

The value of i is 0. Since this information is enough to determine the truth value of the boolean expression.
So the statement following the if statement is not executed.
The values of i and j remain unchanged and get printed.

Workspace

Tags:

No Tags on this question yet!

4. What is the output of the following 'C' program ?

include
void main ()
{
int i = 32,j = 0x20, k, l, m;
k = i|j;
l = i & j;
m = k^l;
printf ("%d %d %d %d %d", i, j, k, l, m);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

5. What is the output of the following 'C' program ?

#include
void main ()
{
unsigned int m = 32;
printf("%d",~m);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

6. What would be the output of the following program ?

#include
void main ()
{
unsigned int a = 0xffff;
~a;
printf ("%x", a);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

7. What is the output of the following 'C' program ?

#include
void main ()
{
unsigned char i = 0x80;
printf("\n%d", i << 1);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

8. What is the output of the following program ?

#include
void main() {
int k = -7;
printf(""%d"",0 }

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

9. What is the output of the following 'C' program ?

#include
void main()
{
if(~0 == (unsigned int)-1)
printf("Hello");
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

10. What is the output of the following 'C' program ?

#include
void main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!