what library to mention for swap function in c++
#include<bits/stdc++.h>
what library to mention for swap function in c++
#include<bits/stdc++.h>
swap using Function template in c++
#include <bits/stdc++.h>
using namespace std;
template<class T , class T1>
void excha(T &a , T1 &b){
T temp = a;
a = b;
b = temp;
}
int main(){
// int a , b;
// cout<<"Enter the value of a and B "<<endl;
// cin>>a>>b;
// excha(a,b);
// cout<<a<<" "<<b<<endl;
// cout<<endl;
// float a , b;
// cout<<"Enter the value of a and B "<<endl;
// cin>>a>>b;
// excha(a,b);
// cout<<a<<" "<<b<<endl;
cout<<endl;
float a ;int b;
cout<<"Enter the value of a and B "<<endl;
cin>>a;
cin>>b;
excha(a,b);
cout<<a<<" "<<b<<endl;
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us