Given 2 strings, return the max number that can be formed by joining them.
For example, if the strings are:
45 and 456
2 numbers are possible
45456
45645
The output should be
45645

Solution:

#include<stdio.h>
#include<string.h>
int main(int argc, char * argv[]){
int a, b,min,i;
char *st;
 
 a= strlen(argv[1]);
 b= strlen(argv[2]);
 min= a < b ? a : b ;

 for(i=0;i<min;i++){
     if (argv[1][i] < argv[2][i]){
             st=  strcat(argv[2],argv[1]);

              printf("%s",st);
              return 0;

     }
     else if  (argv[1][i] > argv[2][i]){

             st=  strcat(argv[1],argv[2]);

              printf("%s",st);
              return 0;

     }
     // noted equal case ignored and later taken care of.. 
   }

// if the argv[1], argv[2] is prefix of one then this check is needed

   if (a<b){
     if (argv[1][0] >= argv[2][min] )
          st= strcat(argv[1],argv[2]);
     else 
             st=  strcat(argv[2],argv[1]);
   }
   else { 
     if (argv[2][0] >= argv[1][min] )
          st= strcat(argv[2],argv[1]);
     else 
             st=  strcat(argv[1],argv[2]);
   }

     printf("%s",st);
     return 0;
}