for this excercise follow the cdecl protocol for the specifi

for this excercise follow the cdecl protocol for the specified procedure and write a short console32 test-driver program to test the procedure.

write a value-returning procedure max3 to find the largest of three double word integer parameters.

Solution

//write a value-returning procedure max3 to find the largest of three double word integer parameters.
//Takes 3 integers as input, and returns the maximum of the three values.
int max3(int a, int b, int c)
{
if(a > b)
return a > c ? a : c;
else
return b > c ? b : c;
}
//Test driver program to check max3() function.
int main()
{
int a, b, c;
printf(\"Enter three integers: \");
scanf(\"%d%d%d\", &a, &b, &c);
printf(\"The maximum of three given integers is: %d\ \", max3(a, b, c));
}

for this excercise follow the cdecl protocol for the specified procedure and write a short console32 test-driver program to test the procedure. write a value-re

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site