Why does printf show an additional % character in the terminal?

前端 未结 1 639
无人及你
无人及你 2021-01-22 07:30

I started learning to code with the C language. I wrote the following program:

#include

int main()
{
   int count = 0;

   printf("Count %d.&         


        
相关标签:
1条回答
  • 2021-01-22 08:00

    Your shell is likely adding a % sign to indicate that the line was not properly terminated. Many shells do this, like for example ZSH or Fish.

    Just add a \n to your call to printf and you're good.

    0 讨论(0)
提交回复
热议问题