Give a = 12 and b = 36 write a C function/macro that returns 3612 without using arithmetic, strings and predefined functions.
We strongly recommend you to minimize your browser and try this yourself first.
Below is one solution that uses String Token-Pasting Operator (##) of C macros. For example, the expression “a##b” prints concatenation of ‘a’ and ‘b’.
Below is a working C code.
Thanks to an anonymous user to suggest this solution.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- What’s difference between header files "stdio.h" and "stdlib.h" ?
- How to print a variable name in C?
- Storage Classes in C
- Static Variables in C
- Arrays in C/C++
- Diffference between #define and const in C?
- Interesting Facts about Macros and Preprocessors in C
- Difference between pointer and array in C?
- Branch prediction macros in GCC
- Variable length arguments for Macros
- Initialization of variables sized arrays in C
- CRASH() macro - interpretation
- The OFFSETOF() macro
- Do not use sizeof for array parameters
- Write a C macro PRINT(x) which prints x