the value stored in variable d will b the character whose ascii value is value of variable a. eg- a=97; printf("%c",a); toutput will b a whose ascii value is 97
actually sprintf converts the integer into a charachter. What it means is saving the first byte of a integer starting from LSB is pulled out to the character variable and discards all the other 3 bytes, as a character can store only 1 byte.
So now in your program a = 10; i.e in binary [00000000 00000000 00000000 00001010] when u do sprintf u save in d the first byte from right i.e d = [00001010] whose decimal value is 10 and corresponding to this ascii value you have got '\n' character which is your output for this program.
sprintf converts the first byte of integer and store it to the character. So, it convers integer into character. So, the integer 10 is converted into character with ASCII value 10. d=10. And the character with ASCII value 10 is '\n' i.e. new line character.