Yes. You've got the input and it's going into an array, right? So you need to
(1)loop over the input array, which you know how to do (lines 13-18 of your posted code) and
(2)check each member of the array to see that it's a palindrome (your current code only checks one of the words, the last one, but you know how to check that it's a palindrome) and
(3)put the result into an array of results, which you know how to do.This suggests that you could have (1), (2), and (3) in the same loop, since you're doing the same thing to everything you handle, and the results should have the same index as the input.
So you see, you've got all the code. Now you just need to put it together so it does what you want. Have fun.
okay sir thank for this...i will write again if i have doubt sir...more power to you...