Skip to content

Instantly share code, notes, and snippets.

@MaratB
Last active December 23, 2015 16:39
Show Gist options
  • Save MaratB/6663839 to your computer and use it in GitHub Desktop.
Save MaratB/6663839 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <conio.h>
int MinMax(int a,int b, int &Max)
{
if (a>b) {Max=a; return b;}
else {Max=b; return a;}
}
main()
{
int N,M,min,max;
while(1)
{
printf("\nEnter 2 integers: \n");
scanf("%d%d", &N,&M);
min= MinMax(N,M,max);
if (N==0 && M==0) break;
printf("Min %d, Max %d\n", min, max);
printf("\nTo exit the programm, press 0 0 ! \n");
}
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment