Untitled

Anonymous
c_cpp
02/15/2024 5:53 PM
360 B
14
Indexable

#include <iostream>
#include <string>
using namespace std;

void swap(int a, int b) {
	int temp = a;
	a = b;
	b = temp;
}

int main()
{
	int x = 5;
	int y = 10;
	cout << x << y << endl;

	swap(x, y);

	cout << x << y << endl;
	
	return 0;
}

Editor is loading...
Leave a Comment