在字符串中输出'%'字符格式问题
要求输出为:
3%5=3
可是下面输出格式为何不对?另外在字符串中输出'%'字符除
了用转义字符还有没有其它办法?
#include <stdio.h>
main()
{
int iA=3,iB=5,iC=0;
iC=iA%iB;
printf("%d/%d=%d\n",iA,iB,iC); /* output ok ! */
printf("%d\x25%d=%d\n",iA,iB,iC); /* output error ! ?? */
printf("%d_\x25_%d_=_%d\n",iA,iB,iC); /* output error ! ?? */
printf("%d_\x25%_%d=%d\n",iA,iB,iC); /* output ok ! */
}