In this article, we have explored about Swapping of 2 variables. We have presented different methods to do so including swapping using third variable, using arithmetic operations, XOR, macro and much more along with their pros and cons.
Table of ContentsIntroduction to SwappingUsing a third variableUsing arithmetic operators and -Using arithmetic operators * and /Using bitwise XOR operator ^Using a macroOther MethodsUsing a file as bufferUsing a command-line-related variable as buff...
Published on September 11, 2021 11:27