C Programming - Bitwise Operators - Discussion

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

int main()
{
    char c=48;
    int i, mask=01;
    for(i=1; i<=5; i++)
    {
        printf("%c", c|mask);
        mask = mask<<1;
    }
    return 0;
}
12400
12480
12500
12556
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
70 comments Page 6 of 7.

Jayesh said:   8 years ago
Thanks, nice explanation @Amey.

Merlin said:   8 years ago
Good Explanation, thanks @Amey.

Kaveri said:   1 decade ago
How to calculate ASCII value?

Bhavesh said:   1 decade ago
"c|mask" what does it mean?

Rohit Singh said:   9 years ago
Thanks, @Sai & @Thirumalai.

Srujana said:   5 years ago
Thanks all for explaining.
(2)

Rohit said:   1 decade ago
@Sai. Thank you very nuch.

Komal said:   8 years ago
Very nice, Thank you all.

Pramod Soni said:   1 decade ago
Thank you very much Amey.

Sowmya said:   1 decade ago
Thanks a lot Sai!! :) :)


Post your comments here:

Your comments will be displayed after verification.