How to merge the digits of two numbers in descending order in C

2 Answers

0 votes
#include <stdio.h>

#define MERGE(x, y) y##x

int main() {
   printf("%d\n", MERGE(23, 91));
   
   return 0;
}
 
 
 
/*
run:
 
9123
 
*/

 



answered Jul 16, 2020 by avibootz
0 votes
#include <stdio.h>

#define MERGE(x, y) y##x

int main() {
   int n = MERGE(23, 91);
   
   printf("%d\n", n);
   
   return 0;
}
 
 
 
/*
run:
 
9123
 
*/

 



answered Jul 16, 2020 by avibootz

Related questions

1 answer 114 views
1 answer 179 views
1 answer 119 views
1 answer 117 views
3 answers 199 views
...