The printf() function will return the number of characters printed. But in the code below
why is it printing 5.
int a=1000;
printf("%d",printf("\n%d",a));
It prints "1000" once and a space, so altogether we have 5 characters.
It should output "1000 2". But its outputting "1000 5".
The number of characters output is 5.
1000is four characters.\nis one character.printfdoesn’t return the number of “items” output like thescanffamily of functions do for input. It returns the actual character count.