© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

CPP Program For Number Puzzle
#include #include #include #include int sum=0,w=0,wn,v[8],td=0,w1[8],j1[8],arr[8],arr1[8],e1,count,d2,y1; int var,a[8][8],d[8],p[8],n1,c,c1,w2; int i,j,n,s,e; void main() { int gd=DETECT,gm; clrscr(); void draw(int ,int ); void dijkstra(int s,int e,int v1[8],int d1[8],int p1[8],int a1[8][8],int n); void ssp(); void path(); void initial(); printf("\nThere are 8 routers in each subnet"); n=8; for(i=0;ij1[v1]) { line(x,y,x,y-1); delay(10); y=y-1; } else { line(x,y,x,y+1); delay(10); y=y+1; }}} if(y==j1[v1]) { while(x!=w1[v1]) { if(x>w1[v1]) { line(x,y,x-1,y); delay(10); x=x-1; } else { line(x,y,x+1,y); delay(10); x=x+1; }}} if(xw1[v1]&&y>j1[v1]) { while(x!=w1[v1]) { line(x,y,x-1,y-s); delay(10); x=x-1; y=y-s; i=i+1; }} if(x>w1[v1]&&yj1[v1]) { while(x!=w1[v1]) { line(x,y,x+1,y-s); delay(10); x=x+1; y=y-s; i=i+1; } }} void ssp() { d2=y1=32767; setcolor(RED); e1=e; for(i=0;i

Sample Output :

There are 8 routers in each subnetEnter the weight between 0 & 1 : 6
Enter the weight between 0 & 3 : 2
Enter the weight between 1 & 5 : 4
Enter the weight between 1 & 2 : 1
Enter the weight between 2 & 4 : 3
Enter the weight between 2 & 3 : 2
Enter the weight between 3 & 7 : 5
Enter the weight between 4 & 5 : 4
Enter the weight between 4 & 7 : 6
Enter the weight between 5 & 6 : 6
Enter the weight between 6 & 7 : 7
Enter source and destination node from network 1 1 4

 

 
SLogix Student Projects


⇓Student Projects⇓
⇑Student Projects⇑
bottom