please help me to this one

Recommended Answers

All 8 Replies

ah ok sorry for that, but i only know how to put the process but i dont know how to make the complete LCFS program

ah ok sorry for that, but i only know how to put the process but i dont know how to make the complete LCFS program

By Process i think you meant algorithm for the code, or how such a scheduling is done by the CPU. Well it doesn't matter what you have. Share it, so that we can make sure, we are helping someone who is ready to sweat a bit for himself...Thats all there is to it. Show some effort, and we will help...:D

#include <stdio.h>
#include<stdio.h>
main()


{
float avgwt,avgtt;
char pname[10][10],c[10][10];
int wt[10],tt[10],bt[10],at[10],t,q,i,n,sum=0,sbt=0,ttime,j,ss=0;
printf("\n\nEnter the number of processes:");
scanf("%d",&n);
printf("\n\n Enter the NAME, BURST TIME and ARRIVAL TIME of thr process");
for(i=0;i<n;i++)


{
printf("\n\nNAME : ");
scanf("%s",&pname);
printf("\n\nBURST TIME : ");
scanf("%d",&bt);
printf("\n\n ARRIVAL TIME :");
scanf("%d",&at);
}
}


this all i got, i dont know what's next to do

*Wrap your codes in code tags*

so what exactly do you want the program to do?
You need to write more details, It will give us and you a hint of what to do next

Also just noted that your using the library stdio.h from C are you sure that your suppose to code in C++ since you posted in the C++ forum?

yeah im using C, because our prof teach only in C, im only a first year college, but i know its only same

i want a program that process the scheduling the LAST COME, FIRST SERVE

yeah im using C, because our prof teach only in C, im only a first year college, but i know its only same

i want a program that process the scheduling the LAST COME, FIRST SERVE

your in the wrong forum you should have posted this in the C forum
and no,for C and C++ there's a lot of differences about the two

for example just printing the output...
in C

printf("this is C \n");

in C++

cout << "This is C++" << endl;

And now for your code... just saying "process the scheduling the LAST COME, FIRST SERVE" is not explaining much, so my suggetstions would just be my interpretation of the problem

I think it would be a lot easier if you use an array of structure
then use a loop that will swap the contents of the last element to the first element of a structure until the elements of the whole array has been reversed

By the way, it's LIFO (Last In First Out), not LCFS

Moved...

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.