Electrofriends

C Program for Priority CPU Scheduling Algorithm

by Ranjith | September 19th, 2009.

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 priority:1
p_name P_time priority w_time
eee 1 1 0
ddd 5 2 1
ccc 2 3 6
bbb 3 4 [...]

Read More..

C Program for Optimal Page Replacement Algorithm

by Ranjith | September 19th, 2009.

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

Read More..

C program for LRU page replacement algorithm

by Ranjith | September 19th, 2009.

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

Read More..

Program for FIFO page replacement algorithm

by Ranjith | September 19th, 2009.

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

Read More..

C Program for FCFS CPU scheduling algorithm

by Ranjith | September 19th, 2009.

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

Read More..

Program for Deadlock detection algorithm

by Ranjith | September 19th, 2009.

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 0
enter resource vector :
2 1 1 2 1
enter the availability vector [...]

Read More..

Program for Cyclic Redundency Check

by Ranjith | September 19th, 2009.

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

OUTPUT:
frame received correctly

Read More..

Program for character stuffing

by Ranjith | September 19th, 2009.

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

Read More..

Program for Bit Stuffing

by Ranjith | September 18th, 2009.

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

Read More..

To reverse the given string using pointer

by Ranjith | December 4th, 2008.
To reverse the given string using pointer

This is the program to reverse the given string and display. The program internally uses the logic of reversing the word.
Logic: The approach here is to reverse the string using the pointers. Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a function [...]

Read More..

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya