Senin, 20 Mei 2013

Modul 4.3

Modul  4.3

http://www.youtube.com/watch?v=CW88GFC_9mA

Listing Program

//Modul 4-3
//Operator Bitwise.cpp
//Nama : WULAN KANDIANI KUSUMAH WARDANI NRP : 49013036

#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    int U, V, W;
    U = 1 << 1;
    V = 1<< 2;
    W = 1 << 3;

    cout << "1 << 1 = " << U << endl;
    cout << "1 << 2 = " << V << endl;
    cout << "1 << 3 = " << W << endl << endl;

    int X,Y,Z;
    U = 16 >> 1;
    V = 16 >> 2;
    W = 16 >> 3;
    cout <<"16 >> 1 = "<< U << endl;
    cout <<"16 >> 2 = "<< V << endl;
    cout <<"16 >> 3 = "<< W << endl;

    int A = 1;
    int B = 0;
    cout << "A = " << A << endl;
    cout << "B = " << B << endl;
    cout <<" !A = "<< !A<< endl;
    cout <<"!B = "<< !B << endl;
    cout << "A & B = "<< (A & B) << endl;
    cout << "A | B = "<< (A | B) << endl;
    cout << "A ^ B = "<< (A ^ B) << endl;

    system ("pause");
    return 0;
}
 

Tidak ada komentar:

Posting Komentar