Created
December 18, 2014 15:54
-
-
Save krishnan793/4cc532443207de98373d to your computer and use it in GitHub Desktop.
Create and Delete 'n' no: of Folders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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