printf()
中的转换说明符始终以%
字符开头。 如果要输出%
字符,请使用转义序列%%
。
#include <stdio.h>
int main(void)
{
int salary; // Declare a variable called salary
salary = 10000; // Store 10000 in salary
printf("My salary is %d./n", salary);
printf("My salary is %%d./n", salary);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266600.html