Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Swap Function

    int a, b;

    cout << "Input first number: ";
    cin >> a;
    cout << "Input second number: ";
    cin >> b;

    swap (a, b);

    cout << "After swapping the first number: " << a << endl;
    cout << "After swapping the second number: " << b << endl;
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Swap #Function
ADD COMMENT
Topic
Name
9+7 =