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
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- C Programming Language Standard
- Features of C Programming Language
- Introduction to the C99 Programming Language : Part III
- Introduction to the C99 Programming Language : Part I
- Introduction to the C99 Programming Language : Part II
- Benefits of C language over other programming languages
- Programming puzzle (Assign value without any control statement)
- Difference Between C Language and LISP Language
- Signals in C language
- Difference between while(1) and while(0) in C language
- fgets() and gets() in C language
- C Language Introduction
- Stopwatch using C language
- kbhit in C language
- lvalue and rvalue in C language
- isupper() function in C Language
- isxdigit() function in C Language
- How to use POSIX semaphores in C language
- isalnum() function in C Language
- Arrays in C Language | Set 2 (Properties)