C Program to show an example of Priority Scheduling # include <stdio.h> void main ( ) { int n , i , j , k , pos [ 30 ] , pr [ 30 ] , temp1 , temp2 , temp3 , s = 0 , r = 0 , x = 0 , a [ 30 ] , e [ 30 ] , t [ 30 ] , w [ 30 ] ; float m , p = 0 ; printf ( "Enter the number of process:" ) ; scanf ( "%d" , & n ) ; printf ( "Enter the execution time and the priority for each\n" ) ; for ( i = 0 ; i < n ; i ++ ) { printf ( "Burst time:" ) ; scanf ( "%d" , & a [ i ] ) ; printf ( "Priority:" ) ; scanf ( "%d" , & pr [ i ] ) ; pos [ i ] = i ; } for ( i = 0 ; i < n ; i ++ ) for ( j = 0 ; j < n ; j ++ ) if ( pr [ i ] < pr [ j ] ) { temp3 = a [ i ] ; ...
Get the latest unboxing and tech news at you fingertips. Collect Software and other precious data overtime