Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int MinMax(int a, int b)
- {
- int min, max;
- if (a>b)
- {
- min = b;
- max = a;
- }
- else
- {
- min = a;
- max = b;
- }
- //return min, max;
- /** How can I return both min and max to the main function??? **/
- }
- int main ()
- {
- int n, a, b, i, min, max;
- scanf("%d", &n);
- for (i=1; i<=n; i++)
- {
- scanf("%d %d", &a, &b);
- MinMax(a,b);
- printf("min is %d\nmax is %d\n", min, max);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement