DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR CPP
swap two numbers
int
a
=
4
;
int
b
=
5
;
a
=
a
+
b
;
// 4 + 5 = 9
b
=
a
-
b
;
// 9 - 5 = 4
a
=
a
-
b
;
// 9 - 4 = 5
PREVIOUS
NEXT
Tagged:
#swap
#numbers
ADD COMMENT
Topic
COMMENT
Name
7+1 =
Submit