Electrofriends

C Program to implement Hermite curves for a given set of control points.

by Ranjith | October 2nd, 2009.

point p1,p2;
printf(“Enter 2 hermite points:\n”);
scanf(“%d%d%d%d”,&p1.x,&p1.y,&p2.x,&p2.y);
printf(“Enter the tangents at p1,p4″);
scanf(“%d%d”,&r1,&r4);
cleardevice();

Read More..

C Program to implement the midpoint circle drawing algorithm

by Ranjith | October 2nd, 2009.

C Program to implement the midpoint circle drawing algorithm to draw a circle. Modify the algorithm toimplement specified arc or sector.

Read More..

C Program to implement Kite flying

by Ranjith | October 2nd, 2009.

void main()
{
int gd=DETECT,gm;
int x=10,y=480;
initgraph(&gd,&gm,”..\\bgi”);
while(!kbhit())
{
cleardevice();
if(y==0)

Read More..

C program for SJF CPU Scheduling Algorithm

by Ranjith | September 20th, 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..

C program for Round Robin CPU Scheduling Algorithm

by Ranjith | September 20th, 2009.

INPUT :
enter the process name : aaa
enter the processing time : 4
enter the process name : bbb
enter the processing time : 3
enter the process name : ccc
enter the processing time : 2
enter the process name : ddd
enter the processing time : 5
enter the process name : [...]

Read More..

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..
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya