program forSINGLE LEVEL DIRECTORY using c-language


SINGLE LEVEL DIRECTORY
#include<stdio.h>
#include<conio.h>
main()
{
int master,s[20];
char f[20][20][20];
char d[20][20];
int i,j;
clrscr();
printf("enter number of directorios:");
scanf("%d",&master);
printf("enter names of directories:");
for(i=0;i<master;i++)
scanf("%s",&d[i]);
printf("enter size of directories:");
for(i=0;i<master;i++)
scanf("%d",&s[i]);
printf("enter the file names :");
for(i=0;i<master;i++)
for(j=0;j<s[i];j++)
scanf("%s",&f[i][j]);
printf("\n");
printf(" directory\tsize\tfilenames\n");
printf("*************************************************\n");
for(i=0;i<master;i++)
{
printf("%s\t\t%2d\t",d[i],s[i]);
for(j=0;j<s[i];j++)
printf("%s\n\t\t\t",f[i][j]);
printf("\n");
}
printf("\t\n");
getch();
}

6 comments:

  1. Please upload program for ACYLIC GRAPH DIRECTORY

    ReplyDelete
  2. Please upload program for ACYLIC GRAPH DIRECTORY

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. ********* means you to write the code neatly

    ReplyDelete
  5. how to compile and run this program on linux?
    I means commands

    ReplyDelete