why we initialize new variable while doing swap #4
Unanswered
aayusranjan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
int temp
we are creating a temporary variable that can store the integer value. for examplehere, we are swapping
a
andb
by storinga
in temporary variable and after that we are storingb
value ina
then at last we are initializingb = temp
that means we that a value are now in bBeta Was this translation helpful? Give feedback.
All reactions