Intro C++ Write a function that takes three pointers to int as arguments. Your f
ID: 648542 • Letter: I
Question
Intro C++
Write a function that takes three pointers to int as arguments. Your function should put the lowest of the three input values in the first argument. The second lowest in the middle argument. The highest value in the third argument. As they are call-by-reference there is nothing to return. Print the value of each argument before and after you call the function.
If you call your function as follows, x containing 2 as the first argument, y containing 5 as the second argument, and z containing 1 as the third argument, after it returns, x should have the value 1, y should have the value 2 and z should have the value 5.
Also create makefile.
Explanation / Answer
#include<conio.h>
#include<stdio.h>
void arrange(int *a,int *b,int *c)
{int temp=a;
if((a<b)&&(a<c))
{temp=a;}
elseif((a<b)&&(a>c)
{temp=c;}
elseif((a>b)&&(a<c))
{temp=b;}
a=temp;
if(b>c){temp=b;
b=c;
c=temp;}
}
void main()
{int min,med,max;
printf(
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.