Adding two numbers without using operators

后端 未结 3 733
迷失自我
迷失自我 2020-12-04 01:49

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条回答
  •  不思量自难忘°
    2020-12-04 02:05

    printf("%*c", n, c) prints the character c, n times. So the code prints 3 spaces followed by 4 spaces, and printf returns the number of characters printed, which is obviously 3 + 4, completing the problem.

提交回复
热议问题