answersLogoWhite

0


Best Answer

#include<stdio.h>

struct RRS

{

char p[2];

int btime;

}a[5];

void main()

{

struct RRS a[5];

int i,j,n,k=0,totalbtime=0;

printf("\nEnter the no of process");

scanf("%d",&n);

for(i=0;i<n;i++)

{

printf("\n enter the process name and burst time");

scanf("%s %d", a[i].p, &a[i].btime);

}

for(i=0;i<n;i++)

{

printf("\n process: %s \t btime : %d",a[i].p,a[i].btime);

totalbtime=totalbtime+a[i].btime;

}

while(k<totalbtime)

{

for(i=0;i<n;i++)

{

for(j=0;j<2;j++)

{

if(a[i].btime!=0)

{

printf("%s",a[i].p);

a[i].btime--;

k++;

}

}

}

}

}

output:

enter the no of process:3

enter the process name and btime:p1 4

enter the process name and btime:p2 3

enter the process name and btime:p3 1

processname btime

p1 4

p2 3

p3 1

p1p1p2p2p3p1p1p2

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you print gantt chart for round robin in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do draw the Gantt chart to illustrate Round-robin scheduling?

You can draw the Gantt chart by using Microsoft Excel which will allow you to input the exact data you have collected and be able to determine the results in various ways.


What will happenend in round robin scheduling if time slice is too large?

If the set time is too short, then too much process switching will take place and the design will become slow. If the set time is too long, then the system may become unresponsive, time wasting and would emulate First Come First Served.


Why was Robin Hood at the round table?

Robin Hood wasn't at the round table


Which feature takes priority-round robin or netmask orderingDNS server?

Round Robin takes precedence


What are soccer round robin?

A round robin competition is when every team plays every other team.


What is virtual round robin CPU scheduling?

A variant of round robin scheduling is called selfish round robin scheduling. In selfish round robin, there is a maximum limit on the number of processes that can be placed in the round-robin queue (including the process being executed by the CPU). After that maximum is reached, newly entering processes are placed on a holding queue. Processes in the holding queue do not get any time slice of the CPU. When a process in the round-robin queue completes and leaves the system, the oldest process in the holding queue is allowed to enter the round-robin queue


What is Output Controlled Grant-based Round Robin?

what is Output Controlled Grant-based Round Robin ?.what for it is used ?.


What are the ratings and certificates for Round Robin - 1973?

Round Robin - 1973 is rated/received certificates of: Finland:(Banned)


Difference between round robin scheduling and Weighted round robin scheduling?

One is weighted, the other is not. Simple as.


What kind of data structure is required to implement the round robin scheduling policy?

The circular queue data structure is required to implement the round robin scheduling policy. Round robin is similar to FCFS scheduling.


How is round robin tennis played?

In a round robin every player in that particular draw plays everyone else in the draw.


Where would you find a picture of a round robin?

Go to redesign.birds.cornell.edu And then you will seee a picture of a Round Robin. That is it. I hope this answers your question!