Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<conio.h>
- main()
- {
- int jobsize[100];
- int partsize[100];
- int x, y, choice;
- int row;
- estrela:
- clrscr();
- printf("\n\n\n\n\t\t DYNAMIC MEMORY ALLOCATION and PARTITION");
- printf("\n\n");
- printf("\n\t\t Jesus Reigns Christian College II - BSIT");
- printf("\n\n\t\t Presented by : Sabellano, Ar-Jay");
- printf("\n\t\t Nonato, Lyndon Christian");
- printf("\n\t\t Lipayon, Erikson");
- printf("\n\n\n\n\t\t\t\tContinue [1]");
- printf("\n\t\t\t\tExit [2]");
- printf("\n\n\t\t\t\t Choice : ");
- scanf("%d", &choice);
- if (choice == 1)
- {
- goto erika;
- }
- else if(choice == 2)
- {
- exit(1);
- }
- else
- {
- goto estrela;
- }
- erika:
- clrscr();
- printf("\n\n\t\tEnter number of partitions : ");
- scanf("%d", &y);
- for (row=1; row<=y; row++)
- {
- printf("\t\tEnter size for partition#%d : ", row);
- scanf("%d", &partsize[row]);
- }
- printf("\n\n\t\tEnter number of jobs : ");
- scanf("%d", &x);
- for(row=1; row<=x; row++)
- {
- printf("\t\tEnter size for job#%d : ", row);
- scanf("%d", &jobsize[row]);
- }
- clrscr();
- printf("\n\n\t\tDisplaying your allocation and partition...\n\n");
- printf("\t\tPARTITION ALLOCATION");
- printf("\n\t\t*------------------*\n");
- for (row=1; row<=y; row++)
- {
- printf("\t\tPartition #%d = %d\n", row, partsize[row]);
- }
- printf("\n\t\tJOB ALLOCATION");
- printf("\n\t\t*------------------*\n");
- for (row=1; row<=x; row++)
- {
- printf("\t\tJob #%d = %d\n", row, jobsize[row]);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement