Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

/*Write different programs to demonstrate the use of bitmanipulation operators.

ID: 3617073 • Letter: #

Question

/*Write different programs to demonstrate the use of bitmanipulation operators. Write a program which takes two numbers, displays them inbinary numbers and then displays the results of AND, OR and Exclusive OR of thesenumbers in binary numbers so that operations can be clearly understood.*/ #include<iostream.h> using namespace std; int main() {    unsigned long int deci;    unsigned long int i=0;    unsigned long int x;    unsigned long int k[100];    cout << "Please enter the number toconvert it in binary: ";    cin >> deci;    cout << endl;    while (deci > 0)    {    x=deci%2;    k[i]=x;    i++;    cout<<x;    deci=deci/2;    }       cout <<endl;    system("pause"); }



If i enter 100 as decimal number, program gives output0010011 but 100 binary is 1100100 output is inverted how i invert my output..... Please help... Will rate /*Write different programs to demonstrate the use of bitmanipulation operators. Write a program which takes two numbers, displays them inbinary numbers and then displays the results of AND, OR and Exclusive OR of thesenumbers in binary numbers so that operations can be clearly understood.*/ #include<iostream.h> using namespace std; int main() {    unsigned long int deci;    unsigned long int i=0;    unsigned long int x;    unsigned long int k[100];    cout << "Please enter the number toconvert it in binary: ";    cin >> deci;    cout << endl;    while (deci > 0)    {    x=deci%2;    k[i]=x;    i++;    cout<<x;    deci=deci/2;    }       cout <<endl;    system("pause"); }



If i enter 100 as decimal number, program gives output0010011 but 100 binary is 1100100 output is inverted how i invert my output..... Please help... Will rate

Explanation / Answer

please rate - thanks you are building the number backwards, so you must print the numberbackwards #include using namespace std; int main() {     unsigned long int deci;     int i=0,j;     unsigned long int x;     unsigned long int k[100];     cout > deci;     cout =0;j--)         cout