Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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 pujasharma5431.medium.com #
 
PREVIOUS NEXT
Tagged: #Swapping #variable #initializing #variable
ADD COMMENT
Topic
Name
4+8 =