Sunday, 09.08.2020, 21:30
Welcome Guest | RSS
Site menu
Login form
Section categories
Search
Calendar
«  June 2011  »
SuMoTuWeThFrSa
   1234
567891011
12131415161718
19202122232425
2627282930
Entries archive
Our poll
Rate my site
Total of answers: 6
Statistics

Total online: 1
Guests: 1
Users: 0
Main » 2011 » June » 10 » Exchanging values by XOR
17:42
Exchanging values by XOR
#include <iostream>


using namespace std;

int main()
{
    int a,b;
        cin>>a>>b;
        a^=b;
        b=a^b;
        a^=b;
        cout<<endl<<a<<endl<<b<<endl;
    return 0;
}

Category: C++ programs | Views: 374 | Added by: H_Imirzyan | Tags: values, value, xor, exchanging, exchange | Rating: 0.0/0
Total comments: 0
Name *:
Email *:
Code *: