#include<stdio.h>
#include<conio.h>

#define n 20

main()
{
  int d,p;
  int b,i,n,bt[20],at[20],num;
  int arr[20];

  clrscr();
  printf("ENTER THE NUMBER OF PROCESSES:	");
  scanf("%d",&n);

  for(i=0;i<n;i++)
  {
    gotoxy(10,5);
    printf("PROCESS: %d",i+1);
    gotoxy(25,5);
    printf("BURST TIME :	");
    scanf("%d",&bt[d]);
    gotoxy(50,5);
    printf("ARRIVAL TIME :");
    scanf("%d",&at[p]);
  }

  gotoxy(29,20);
  printf("SELECT ALGORITHM");
  gotoxy(29,25);
  printf("\n[1] - SJF");
  gotoxy(29,30);
  printf("\n[2] - SRTF");
  gotoxy(29,35);
  printf("\n[3] - EXIT");
  gotoxy(25,40);
  printf("\nENTER CHOICE:");
  scanf("%d",&num);
  getch();
}

this is about my sjf project and srtf...........................
pls help me of my project and i badly needed this right now because this is our project so if you have a hurt to help me so pls help me ryt now

Recommended Answers

All 2 Replies

>this is about my sjf project and srtf...........................
What the hell are sjf and srtf? Speak plainly and properly.

>so pls help me ryt now
I'm afraid help is impossible as you haven't described any problem with the posted code. If you'd like a code review, I'll be happy to tell you that your code is crap, but if you want help with a specific problem, you need to describe the problem first.

It's the "Shortest Job First" and "Shortest Remaining Time First" scheduling problem which happens to appear from time to time (and has been answered already). No doubt Round Robin would get added in due course.

> #define n 20
You also have a variable called n, so this won't work.

> gotoxy(25,40);
Until everything else works, I would suggest you forget about making it all nice and pretty. A project which does all the things it needs to, but lacks a little on the presentation side will get you more marks than something which looks fantastic, but does nothing.

Also, you really need to upgrade to a compiler which belongs in this millennium and not the last millennium.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.