Skip to main content

MIN MAX OF TWO NUMBERS

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;
}

Comments

Popular posts from this blog

CMOS TUTORIAL DSCH FILES

CLICK THE PICTURE DOWN BELOW In order to download the files of the DSCH (not screen shots of outputs). The Link includes the files of --> AND Gate , --> INVERTOR Gate, --> OR GATE , --> NAND Gate , --> NOR Gate , --> XOR Gate , --> Expression 1 Gate

Y16 Integer Addition

SUBMISSION LINK https://www.hackerrank.com/contests/y16csecs/challenges/y16-integer-addition #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 long int a,b;     scanf("%lld %lld",&a,&b);     printf("%lld",a+b);     return 0; }