lesser.c
4190 단어 C 언어 연습 문제
//lesser.c --
#include
int imin(int,int);
int main(int argc, const char * argv[]) {
int evil1,evil2;
printf("Enter a pair of integers(q to quit):
");
while (scanf("%d %d",&evil1,&evil2) == 2) {
printf("The lesser of %d and %d is %d
",evil1,evil2,imin(evil1,evil2));
printf("Enter a pair of integers (q to quit):
");
}
printf("Bye!
");
return 0;
}
int imin(int n,int m)
{
int min;
if (n<m)
min=n;
else
min=m;
return min;
}