slip2

By: Anonymous5/19/2023111 views Public Note
#include #include #include int main(void) { char filename[20]; int flag=0; DIR *d; struct dirent *dir; d = opendir("."); printf("\n Enter the file to be searched:: "); gets(filename); if (d) { while ((dir = readdir(d)) != NULL) { //printf("%s\n", dir->d_name); if(strcmp(dir->d_name,filename)==0) { flag=1; break; } } closedir(d); } if(flag==1) printf("%s is present",filename); else printf("%s is not present",filename); return(0); }

Want to create your own notes?

Join thousands of users writing securely on ProNotepad.