fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. unsigned int concat(unsigned int a,unsigned int b)
  5. {
  6. return a * pow(10, trunc(log10(b) + 1)) + b;
  7.  
  8. }
  9.  
  10. int main(void)
  11. {
  12. printf("%u\n", concat(10, 12));
  13. printf("%u\n", concat(235, 1));
  14. printf("%u\n", concat(745, 456787));
  15. printf("%u\n", concat(1, 2));
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5548KB
stdin
Standard input is empty
stdout
1012
2351
3164489491
12