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.


Please wait...

  Take Quiz (Monsoon) Beta Version !!
  Do You have Qs. in your Mind ??? Ask it as Qs. or MCQs or create it as polling Live Now !!

C Programming :: Bitwise Operators

Home > C Programming > Bitwise Operators > General Questions

1 / 34

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

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

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 / 34

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

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

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 / 34

 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);
}

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 / 34

 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);
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

5 / 34

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

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

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

6 / 34

 What would be the output of the following program ?

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

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

7 / 34

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

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

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

8 / 34

 What is the output of the following program ?

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

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

9 / 34

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

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

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

10 / 34

 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);
}

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!