I am having trouble with this program Can someone help pleas
I am having trouble with this program. Can someone help please? *Create a program named TestFileAndDirectory that allows a user to continually enter directory names until the user types \"end\". If the directory name exists, display a list of the files in it; otherwise, display a message indicating the directory does not exist. If the directory exists and files are listed, prompt the user to enter one of the filenames. If the file exists, display its creation date and time; otherwise, display a message indicating the file does not exist. Create as many test directories and files as necessary to test your program.
Solution
Program: TestFileAndDirectory.c
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<dir.h>
/ These are the header files used in our program /
void main()
{
int check;
char *dirname;
clrscr();
printf(\"Enter a directory path and name to be created (C:/name):\");
gets(dirname);
check=mkdir(dirname);
if(!check)
printf(\"directory created\ \");
else
{
printf(\"end\ \");
exit(1);
}
getch();
system(\"dir/p\");
getch();
}
Output:
enter a directory and add the name to be created (C:/name) : C:/test
Directory created.


