1.

WAP to print the maximum and minimum digits of 10 numbersUse two separate function calledint max (int)int min (int)to find the maximum and minimum digit ofeach number respectively. ​

Answer»

Answer:

FIRST of all, how do we return multiple values from a C function? We can do it either using structures or pointers.

We have created a structure NAMED pair (which contains min and max) to return multiple values.

STRUCT pair

{

int min;

int max;

};

And the function declaration becomes: struct pair getMinMax(int arr[], int n) where arr[] is the array of size n whose minimum and MAXIMUM are needed.

Hope it will help you

From: Ace7257



Discussion

No Comment Found