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 5 of 7.

Sachin Behera said:   1 decade ago
How can we know quickly the ASCII value ?

Shravan said:   9 years ago
@Sai.

Very good explanation. Thank you.

Prajkta said:   10 years ago
Please detail explanation this program.

Bhavana said:   1 decade ago
Well said. For clearing my confusion.

Nithy said:   1 decade ago
Doesn't masking mean AND operation?

Razia said:   1 decade ago
Why it is printing only mask value?

Varsha said:   6 years ago
Thanks @Sai, @Jayadeep and @Amey.
(1)

Afsheen said:   1 decade ago
Can anyone please explain this. ?

Vasundhara said:   9 years ago
Thanks, easy explanations @Amey.

Hamilton said:   8 years ago
Thanks for all your explanation.


Post your comments here:

Your comments will be displayed after verification.