Skip to content

Instantly share code, notes, and snippets.

@krishnan793
Created December 18, 2014 15:54
Show Gist options
  • Save krishnan793/4cc532443207de98373d to your computer and use it in GitHub Desktop.
Save krishnan793/4cc532443207de98373d to your computer and use it in GitHub Desktop.
Create and Delete 'n' no: of Folders
#include<stdio.h>
#include<io.h>
void create_folder(int n)
{
int i;
char name[256];
for(i=0;i<n;i++)
{
sprintf(name,"%d",i);
mkdir(name);
}
}
void delete_folder(int n)
{
int i;
char name[256];
for(i=0;i<n;i++)
{
sprintf(name,"%d",i);
rmdir(name);
}
}
void main()
{
create_folder(100);
printf("\n\n100 Folders are created..\n======================\n\n");
system("dir/p");
system("pause");
delete_folder(100);
printf("\n\nFolders are deleted..\n====================\n\n");
system("dir/p");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment