PROBLEM LINK
https://www.hackerrank.com/contests/y16csecs/challenges/y16-min-max-of-two-numbers
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long int a,b;
scanf("%ld %ld",&a,&b);
if(a==b)
{
printf("-1");
}
else
{
if(a<b)
{
printf("%ld %ld",a,b);
}
else
{
printf("%ld %ld",b,a);
}
}
return 0;
}
https://www.hackerrank.com/contests/y16csecs/challenges/y16-min-max-of-two-numbers
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long int a,b;
scanf("%ld %ld",&a,&b);
if(a==b)
{
printf("-1");
}
else
{
if(a<b)
{
printf("%ld %ld",a,b);
}
else
{
printf("%ld %ld",b,a);
}
}
return 0;
}
Comments
Post a Comment