#include<stiod.h>
#include<dirent.h>
struct dirent*dptr;
int main(int argc,char*argv[])
{
char buff[100];
printf("\n\n ENTER DIRECTORY NAME");
scanf("%s,buff");
if((drip=opendir(buff))==NULL)
{
printf("the given directory does not exist")
exit(1);
}
while(dptr=readdir(drip))
{
printf("%s\n",dptr->d_name);
}
closedir(drip);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: