Welcome to the forum, Urjapandya!
Two things:
1) Your program is the same as the program suggested just above your post (Tesu), (but yours is more readable).
2) It would be MUCH better if you had surrounded your code in CODE tags, which makes the forum software keep it looking like a program.
Just click on the [code] symbol, and then paste your code between the two tags that it puts on the editor window for you.
You and Tesu both, have found the more efficient algorithm for detecting palindrome's. Good job! ;)