\* C file handling program to check a specified file exists or not *\
# include < stdio.h >
int main( )
{
FILE* filePtr ;
char filename[20] ;
printf("\n Enter the filename to be opened : ") ;
scanf("%s", filename ) ;
filePtr = fopen(filename, "r" ) ;
if (filePtr == NULL)
{
printf(" file does not exists.\n") ;
return 1 ;
}
printf(" file exists.\n") ;
fclose(filePtr) ;
return 0 ;
}