Home >Backend Development >C++ >A C puzzle in C programming?
In this C programming puzzle, you need to combine two numbers. You cannot use any arithmetic, string, or other functions.
So in this C puzzle -
Input : 12 , 54 Output : 1254
The best solution to this C programming puzzle is to use Token-pasting operator define.
Use the ## token-pasting operator to define a macro to get the merged value. This operator merges together the tokens passed to it.
#include <stdio.h> #define merge(a, b) b##a int main(void) { printf("%d ", merge(432 ,23)); return 0; }
23432
The above is the detailed content of A C puzzle in C programming?. For more information, please follow other related articles on the PHP Chinese website!