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

Sagalakala vallavan said:   1 decade ago
48 ascii value 0.
49 - 1.
50 - 2.
52 - 4.
56 - 8.
Left shift 0.

Chinna said:   2 decades ago
To increment five times in i and multiple by c and i and mask.

Pawan mishra said:   1 decade ago
Thanks sir realy understoodable answer. Thank you so much.

Dhivya said:   7 years ago
How to find ascii value manually?

Please explain.

Dinesh said:   8 years ago
Can we assign an integer value in char data type?

Ginna said:   1 decade ago
How to find binary values during interview tests?

Poobal said:   1 decade ago
Please any one can explan this program clearly ?

Swati said:   1 decade ago
How 48 ASCII is 0? Please anyone explain it?

Sanjana said:   1 decade ago
Thanks amey your explanation is very good.

Ruella said:   1 decade ago
Amey that was impressive and neat! thanks


Post your comments here:

Your comments will be displayed after verification.