Hi Laxman you do first a basic thing
the data lines which you are using to sending that data or the pins/port connected to RS, EN & RW ,
First declare all them(PORTs) as OUTPUT in your main function ,
and instead of Printing a String at the first time try with the the displaying of only 1 character like 'A' using the function
Code:
display('A') ; // as the function has prototype for the same
Then if that is perfect then go for Printing a String and further moving it to left or RIGHT ,
if there is still problem upload for the same !!