C Programming - Bitwise Operators - Discussion

Discussion Forum : Bitwise Operators - Find Output of Program (Q.No. 5)
5.
What will be the output of the program?
#include<stdio.h>

int main()
{
    unsigned char i = 0x80;
    printf("%d\n", i<<1);
    return 0;
}
0
256
100
80
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
65 comments Page 6 of 7.

Kunal said:   1 decade ago
What is the binary value of x (hexadecimal no) ?

Rashmi said:   1 decade ago
Yeah, how can we take two bytes for a character.

Yachana said:   1 decade ago
Why you are taking 2 bytes instead of 1 byte.

Shruti said:   1 decade ago
What is 0x80?

How do we conver it to binary?

Chandini said:   1 decade ago
Please explain briefly about this program.

Rajani R said:   7 years ago
Please someone explain this solution.

Vaishnavi said:   8 years ago
Kindly explain this program clearly.

Namu said:   6 years ago
How 0x80 is converted into binary?
(4)

Davil said:   1 decade ago
What is the meaning of "return 0"?

Divya S said:   1 decade ago
Nice explanation kasi. Thanks.


Post your comments here:

Your comments will be displayed after verification.