Location: NT-LAB PROGRAMS

Discussion: Sending the program for OSPF------PART 2Reported This is a featured thread

Showing 1 post

Posted Anonymously
Sending the program for OSPF------PART 2
Apr 9 2007, 3:34 PM EDT | Post edited: Apr 9 2007, 3:34 PM EDT
for(i=0;i<=num;i++)
{
for(j=i+1;j<=num;j++)
{
& nbsp; if(cost[i]>cost[j])
{
temp=cost[i];
cost[i]=cost[j];
cost[j]=temp;
temp=hop[i];
hop[i]=hop[j];
hop[j]=temp;
temp=router[i];
&nbsp ; router[i]=router[j];
router[j]=temp;
}
}
}
cout<<"\n\n\n\n\n";
cout<<"Possible Shortest Path from the config.\n";
cout<<"Router no\tHop\tcost\n";
cnt =0;
for(i=0;i<=num;i++)
{
cout<<router[i]<<"\t"<<hop[i]<<"\t"<<cost[i]<<endl;
}
getch();
}

Do you find this valuable?    
Keyword tags: None (edit keyword tags)

Be the first to reply.