+ 15
Please anyone can explain me this c++ program ?
#include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b; a=5; b&=a; //point of interest to know cout<<b; getch(); } I want to know why and how its output arrives 4.
7 Answers
+ 18
Porting it over to standard C++,
#include<iostream>
int main()
{
    int a,b;
    a = 5;
    b &= a;
    std::cout<<b;
    return 0;
}
'&=' is the bitwise AND assignment operator. What it does, is to perform a bitwise AND operation and then assign the value to b.
+ 15
Thanks đ
+ 11
it will print the contact of variable "b" on output window
+ 9
How does these bitwise operators work?
+ 2
explain sir..
std::cout<<b      
+ 1
std::    why written







