C语言问题啊 为什么要加putchar('\n')啊?如果是putchar("\n")为什么输出的是D啊 ?

#include"stdio.h"
#define INPUT(x,y) scanf("%d,%d",&x,&y)
#define A(x,y) x%y
#define B(a) printf("%d",a)
#define PRINTF(a) B(a);putchar("\n")
void main()
{
int x,y;
INPUT(x,y);
PRINTF(A(x,y));
}

putchar("\n") 改为 putchar('\n')

//因为putchar函数接收的参数是int类型的,而不是字符串。用双引号扩起来的代表字符串了。编译应该都会有问题的吧。追问

putchar('\n')是指什么吗?应该是可以可有可无的吧.谢谢

追答

putchar('\n'),就是输出一个换行,可以没有的。你可以去掉看看和没去掉有的对比对比就知道了。

温馨提示:答案为网友推荐,仅供参考
相似回答