dotfiles/.config/Code/User/History/57898c00/p35J.cpp

27 lines
268 B
C++
Raw Normal View History

2024-09-09 16:59:28 +05:00
/*
Rafay Ahmad
23I-2526
*/
#include <iostream>
using namespace std;
template <class T>
void swapValues(T& a, T& b){
a += b;
b -= a;
a += b;
}
int main(){
int a = 5;
int b = 3;
swapValues<int>(a, b);
cout<<a<<"\n"<<b;
return 0;
}