I am checking if last word is going to print ,then don't print extra space,still it is failing.Can someone check