C++ problem:
Write a function that:
#include<iostream> using namespace std; void swap(int& a, int& b){ int tmp = a; a = b; b = tmp; } int main() { int a,b; a=5; b=7; swap(a,b); cout<<"a: "<<a<<endl; cout<<"b: "<<b<<endl; return 0; }
void swap(int& a, int& b){ int tmp = a; a = b; b = tmp; }
Get Answers For Free
Most questions answered within 1 hours.