Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Swapping two variable without initializing the third variable

#include <iostream>
using namespace std;
int main()
{
    int first_number = 10, last_number = 20;
    first_number = first_number + last_number;
    last_number = first_number - last_number;
    first_number = first_number - last_number;
    cout << first_number << " " << last_number << endl;
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Swapping #variable #initializing #variable
ADD COMMENT
Topic
Name
8+8 =