\* C file handling program to rename a file using the rename() function *\
# include < stdio.h >
int main( )
{
char oldName[25] ;
char newName[25] ;
int ret = 0 ;
printf("\n Enter old filename: ") ;
scanf("%s", oldName ) ;
printf("\n Enter new filename: ") ;
scanf("%s", newName ) ;
ret = rename(oldName, newName ) ;
if (ret == 0)
printf(" File renamed successfully !\n") ;
else
printf(" Unable to rename file !\n") ;
return 0;
}