C Program for Priority CPU Scheduling Algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 18 Comments

OUTPUT: enter no of processes: 5 enter process1 name: aaa enter process time: 4 enter priority:5 enter process2 name: bbb enter process time: 3 enter priority:4 enter process3 name: ccc enter process time: 2 enter priority:3 enter process4 name: ddd enter process time: 5 enter priority:2 enter process5 name: eee enter process time: 1 enter [...]

C Program for Optimal Page Replacement Algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 9 Comments

OUTPUT :
2 -1 -1
2 3 -1
2 3 -1
2 3 1
2 3 5
2 3 5
4 3 5
4 3 5
4 3 5
2 3 5
2 3 5
2 3 5

no of page faults : 3

C program for LRU page replacement algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 8 Comments

OUTPUT :
2 -1 -1
2 3 -1
2 3 -1
2 3 1
2 5 1
2 5 1
2 5 4
2 5 4
3 5 4
3 5 2
3 5 2
3 5 2
no of page faults : 4

Program for FIFO page replacement algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 17 Comments

OUTPUT :
2 -1 -1
2 3 -1
2 3 -1
2 3 1
5 3 1
5 2 1
5 2 4
5 2 4
3 2 4
3 2 4
3 5 4
3 5 2

Number of page faults : 6

C Program for FCFS CPU scheduling algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 51 Comments

OUTPUT:
enter no of processes: 5

enter process1 name: aaa
enter process time: 4
enter process2 name: bbb
enter process time: 3
enter process3 name: ccc
enter process time: 2
enter process4 name: ddd
enter process time: 5
enter process5 name: eee
enter process time: 1

Program for Deadlock detection algorithm

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 17 Comments

INPUT: enter total no. of processes : 4 enter claim matrix : 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 0 1 enter allocation matrix : 1 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 [...]

Program for Cyclic Redundency Check

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 0 Comment

INPUT:
enter frame :
1 1 1 1 1 1 1 1
enter generator :
1 1 0 1

OUTPUT:
frame received correctly

Program for character stuffing

Saturday, September 19th, 2009  »  Posted By Ranjith  »  Total 6 Comments

INPUT:
enter string:
asdlefgh
enter position: 8
invalid position,enter again: 3
enter the character: k

OUTPUT:
frame after stuffing:
dlestx as dle k dle dle dlefgh dleetx

Program for Bit Stuffing

Friday, September 18th, 2009  »  Posted By Ranjith  »  Total 6 Comments

Enter frame length: 10

Enter input frame (0′s & 1′s only):
1 0 1 0 1 1 1 1 1 1

After stuffing the frame is:
1 0 1 0 1 1 1 1 1 0 1

To calculate area and circumference of the circle

Wednesday, December 3rd, 2008  »  Posted By Ranjith  »  Total 0 Comment

Let us start from the beginning. Here discusses a model program for calculating the circumference and the area of the circle, where the radius is specified by the user. Logic: As we know, Circumference is ‘Pi’ times diameter of the circle and Area is ‘Pi’ times the radius squared. Implementing the same is the main [...]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup