0

Can i swap two number using call by reference function? ??

15th Jan 2019, 12:23 PM
Safal Kumar Sahgal
Safal Kumar Sahgal - avatar
5 Respuestas
+ 2
void swap(int &first, int &second) { int temp = first; first = second; second = temp; }
16th Jan 2019, 12:11 AM
John Wells
John Wells - avatar
+ 1
Thanks sir
16th Jan 2019, 1:40 AM
Safal Kumar Sahgal
Safal Kumar Sahgal - avatar
0
Assuming your language supports reference parameters, sure.
15th Jan 2019, 10:04 PM
John Wells
John Wells - avatar
0
In c++ how can i sir?? Please help
16th Jan 2019, 12:09 AM
Safal Kumar Sahgal
Safal Kumar Sahgal - avatar