Problem statement :This is more informational than a challenge. You can actually switch 2 variables with the XOR operation ^. XOR works with two arguments. It turns both arguments in their binary representation, and for each bit, returns 1 if they are different, 0 otherwise.
The return value is the decimal representation of the new binary string. So, if you don't know how to do it, go play around with it! After some time on paper, you will understand what is going on, and how it works.
Your job is to switch 2 variables using the XOR operator, which means your return statement should be return std::make_pair(a, b), but the variables need to be switched.
Probelm Link : click hereChoose one Cateorgy - Easy
question category : bit_operation,language_fundamentals
Before submitting a PR please Check some details.
[x] fileName format should be in camelcase
example- return Xorswap.cpp
[x] Choose label for Problem , example- "good first issue", "easy"
[x] In file there should be problem statement and link to problem
/* Problem-Task : This program will add two numbers
* Problem Link : https://edabit.com/challenge/dHYXiEXydZxrwntBq
*/
int main() {
int bla;
return 0;
}
Before jumping into Pr first comment for assign.
Problem statement :This is more informational than a challenge. You can actually switch 2 variables with the XOR operation ^. XOR works with two arguments. It turns both arguments in their binary representation, and for each bit, returns 1 if they are different, 0 otherwise.
The return value is the decimal representation of the new binary string. So, if you don't know how to do it, go play around with it! After some time on paper, you will understand what is going on, and how it works.
Your job is to switch 2 variables using the XOR operator, which means your return statement should be return std::make_pair(a, b), but the variables need to be switched.
Probelm Link : click here Choose one Cateorgy - Easy question category : bit_operation,language_fundamentals
Before submitting a PR please Check some details.
This repository is vaild for HacktoberFest2020
Read before making PR - How to contribute on Github Good Luck,