Share your repls and programming experiences

← Back to all posts
5.4
safroz000 (0)

//5.4
//
#include <iostream>
void getnumbers(int& input, int& input2);
//
void swapvalues(int&variable, int&variable2);
//
void showresults(int output, int output2);
//

int main()
{
int firstnum = 0, secondnum = 0;

getnumbers(firstnum, secondnum);
swapvalues(firstnum, secondnum);
showresults(firstnum, secondnum);
return 0;

}
//
void getnumbers (int& input1, int& input2)
{
using namespace std;
cout << "enter two integers: ";
cin >> input1

  >> input2;

}
void swapvalues(int& variable1, int&variable2)
{
int temp;
temp = variable1;
variable1 = variable2;
variable2 = temp;
}
//
void showresults(int output1, int output2)
{
using namespace std;
cout << "in reverse order the numbers are: "
<< output1 << " " << output2 << endl;

}