Skip to main content

Posts

Showing posts with the label Round robin scheduling

C Program to show an example of Round Robin Scheduling

C Program to show an example of Round Robin Scheduling # include <stdio.h> void main ( ) { int i , n , k , s = 0 , r = 0 , q = 0 , x = 0 , a [ 30 ] , e [ 30 ] , t [ 30 ] , w [ 30 ] ; float m , p = 0 ; printf ( "Enter the number of processes:" ) ; scanf ( "%d" , & n ) ; printf ( "Enter the execution time:" ) ; for ( i = 0 ; i < n ; i ++ ) { scanf ( "%d" , & a [ i ] ) ; e [ i ] = a [ i ] ; } printf ( "Enter the quantum time:" ) ; scanf ( "%d" , & q ) ; printf ( "After the r r scheduling:" ) ; while ( s <= k ) { for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] > 0 ) { if ( a [ i ] > q ) { ...