output format _____extra space

Suppose any programming wants me to give output and in the form of integers separated by space. and then I have used printf("%d(space) ",var) .it has been shown that after d in printf there is a space so obviously it will print space after every integer, at the the time of last integer it will also print that space which is not required.CAN THIS BE ALSO A REASON FOR SHOWING WRONG ANS ON SUBMISSION OF THE PROBLEM.

mostly online judges ignore the whitespaces and newlines generated while testing the code.

also it depends on the problem setter, if while uploading the problem the setter haas selected the option ignore whitespace and newlines then it a whitespace or newline will not affect the output.

Read here for more info.