I found this following code for addition of two numbers without using the + operator.
code to add 3 and 4:
printf("%d",printf("%*c%*c",3,' ',4,' '));
Now printf() returns the number of characters in the result
and %*c ignores the next character that it encounters. But still, I am not able to understand this code. Any help would be appreciated.
printf("%*c", n, c)prints the characterc,ntimes. So the code prints 3 spaces followed by 4 spaces, andprintfreturns the number of characters printed, which is obviously 3 + 4, completing the problem.