Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<conio.h>
  4. main()
  5. {
  6.  
  7.     int jobsize[100];
  8.     int partsize[100];
  9.     int x, y, choice;
  10.     int row;
  11.  
  12.     estrela:
  13.     clrscr();
  14.     printf("\n\n\n\n\t\t    DYNAMIC MEMORY ALLOCATION and PARTITION");
  15.     printf("\n\n");
  16.     printf("\n\t\t    Jesus Reigns Christian College II - BSIT");
  17.     printf("\n\n\t\t    Presented by : Sabellano, Ar-Jay");
  18.     printf("\n\t\t                   Nonato, Lyndon Christian");
  19.     printf("\n\t\t                   Lipayon, Erikson");
  20.     printf("\n\n\n\n\t\t\t\tContinue   [1]");
  21.     printf("\n\t\t\t\tExit       [2]");
  22.     printf("\n\n\t\t\t\t  Choice : ");
  23.     scanf("%d", &choice);
  24.  
  25.     if (choice == 1)
  26.     {
  27.         goto erika;
  28.     }
  29.     else if(choice == 2)
  30.     {
  31.         exit(1);
  32.     }
  33.     else
  34.     {
  35.         goto estrela;
  36.     }
  37.  
  38.     erika:
  39.     clrscr();
  40.     printf("\n\n\t\tEnter number of partitions : ");
  41.     scanf("%d", &y);
  42.  
  43.     for (row=1; row<=y; row++)
  44.     {
  45.         printf("\t\tEnter size for partition#%d : ", row);
  46.         scanf("%d", &partsize[row]);
  47.     }
  48.  
  49.     printf("\n\n\t\tEnter number of jobs : ");
  50.     scanf("%d", &x);
  51.  
  52.     for(row=1; row<=x; row++)
  53.     {
  54.         printf("\t\tEnter size for job#%d : ", row);
  55.         scanf("%d", &jobsize[row]);
  56.     }
  57.  
  58.     clrscr();
  59.  
  60.     printf("\n\n\t\tDisplaying your allocation and partition...\n\n");
  61.  
  62.     printf("\t\tPARTITION ALLOCATION");
  63.     printf("\n\t\t*------------------*\n");
  64.  
  65.     for (row=1; row<=y; row++)
  66.     {
  67.         printf("\t\tPartition #%d = %d\n", row, partsize[row]);
  68.     }
  69.  
  70.     printf("\n\t\tJOB ALLOCATION");
  71.     printf("\n\t\t*------------------*\n");
  72.  
  73.     for (row=1; row<=x; row++)
  74.     {
  75.         printf("\t\tJob #%d = %d\n", row, jobsize[row]);
  76.     }
  77.  
  78. getch();
  79. return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement