// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
struct bitler
{
	unsigned	int _1:1;
unsigned	int _2:1;
unsigned	int _3:1;
unsigned	int _4:1;
unsigned	int _5:1;
unsigned	int _6:1;
unsigned	int _7:1;
unsigned	int _8:1;
};
union karakter
{
	unsigned int i;
	struct bitler bt;
};
int _tmain(int argc, _TCHAR* argv[])
{
	union karakter s1;
	union karakter s2;
	cin>>s1.i;
	cin>>s2.i;
	cout<<s1.i<<endl;
	cout<<s1.bt._8;
	cout<<s1.bt._7;
	cout<<s1.bt._6;
	cout<<s1.bt._5;
	cout<<s1.bt._4;
	cout<<s1.bt._3;
	cout<<s1.bt._2;
	cout<<s1.bt._1<<endl<<endl;
	cout<<s2.i<<endl;
	cout<<s2.bt._8;
	cout<<s2.bt._7;
	cout<<s2.bt._6;
	cout<<s2.bt._5;
	cout<<s2.bt._4;
	cout<<s2.bt._3;
	cout<<s2.bt._2;
	cout<<s2.bt._1<<endl<<endl;
	//s1.bt._8=1;
	//s1.i=s1.i<<1;//Sola kaydır
	//s1.i=s1.i>>1;//Sağa Kaydır
	//s1.i=~s1.i;//Tersini al
	//s1.i=s1.i&s2.i; //And İşlemi
	//s1.i=s1.i|s2.i; //OR işlemi
	//s1.i=s1.i^s2.i; //XOR işlemi
	cout<<s1.i<<endl;
	cout<<s1.bt._8;
	cout<<s1.bt._7;
	cout<<s1.bt._6;
	cout<<s1.bt._5;
	cout<<s1.bt._4;
	cout<<s1.bt._3;
	cout<<s1.bt._2;
	cout<<s1.bt._1<<endl<<endl;
	system("pause");
	return 0;
}

