Sign in or 

|
intel_ram2002 |
Latest page update: made by intel_ram2002
, Apr 8 2007, 12:23 PM EDT
(about this update
About This Update
4 words added view changes - complete history) |
|
Keyword tags:
nt
More Info: links to this page
|
| Started By | Thread Subject | Replies | Last Post | ||
|---|---|---|---|---|---|
| Anonymous | Sending the program for OSPF------PART 2 | 0 | Apr 9 2007, 3:34 PM EDT by Anonymous | ||
|
|
Thread started: Apr 9 2007, 3:34 PM EDT
Watch
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];   ; 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(); } |
||||
| Anonymous | Sending the program for OSPF------PART 1 | 0 | Apr 9 2007, 3:33 PM EDT by Anonymous | ||
|
|
Thread started: Apr 9 2007, 3:33 PM EDT
Watch
Sending the program for OSPF(Output just displays all
shortest path routes in the network) #include<iostream.h> #include<conio.h> void main() { clrscr(); int num=0,rinfo[81],sum=0,cnt=0,hop[81],cost[81],router[81],temp=0; cout<<"How Many Routers Between Source And Destination other than router 1???\n"; cin>>num; cout<<"Enter Router Details\n"; for(int i=0;i<num;i++) { cout<<"To how many routers is router\t"<<i+1<<"connected?"; cin>>rinfo[i]; sum=sum+rinfo[i]; if(sum>num+1) { cout<<"Error In Network Config...\n"; break; } } cout<<"Enter the next hop no. and the cost between the connected routers\n"; int j=0; for(i=0;i<num;i++) { cnt=1; while(cnt<=rinfo[i]) { router[j]=i+1; cout<<"Enter the Next Hop!\n"; cin>>hop[j]; cout<<"Enter the cost Between Routers"<<i+1<<"And"<<hop[j]<<" : "; cin>>cost[j]; cnt++; j++; } } cout<<"Router DataBase\n"; cout<<"Router No.\tcost\tNext Hop\n\n"; j=0; for(i=0;i<num;i++) { cnt=1; while(cnt<=rinfo[i]) { cout<<i+1<<"\t"<<hop[j]<<"\t"<<cost[j]<<endl; cnt++; j++; } } |
||||
| Anonymous | FILE TRANSFER PROTOCOL | 0 | Apr 9 2007, 3:28 PM EDT by Anonymous | ||
|
|
Thread started: Apr 9 2007, 3:28 PM EDT
Watch
FILE TRANSFER PROTOCOL
#include<stdio.h> #include<conio.h> #include<fstream.h> #include<dos.h> void main() { clrscr(); FILE *fp; char fname[30],ch; printf("\nCLIENT REQUESTE A FILE FROM SERVER\n"); printf("\n-----------------------------------\n"); printf("\nENTER THE REQUESTED FILE :"); scanf("%s",&fname); printf("\nFILE SENDING"); delay(1000); printf("."); delay(1000); printf("."); delay(1000); printf("."); printf("\n\nFILE SENDING"); delay(1000); printf("."); delay(1000); printf("."); delay(1000); printf("."); printf("\n\nTHE %s FILE HAS BEEN SENT TO SERVER SUCESSSFULLY...",fname); delay(2000); printf("\n\nSERVER SIDE\n"); printf("\n\nREQUESTED FILE FROM THE CLIENT IS : %s",fname); printf("\n\nSEARCHING A %s FILE FROM THE DATABASE.....\n",fname); delay(500); printf("\nSEARCHING."); delay(1000); printf("."); delay(1000); printf("."); delay(1000); printf("."); printf("\n\nSEARCHING."); delay(1000); printf("."); delay(1000); printf("."); delay(1000); printf("."); printf("\n\nFILE FOUND! ! ! ! \n"); printf("\nSERVER FORWARD THE FILE TO REQUESTED CLIENT\n"); printf("\nSERVER FORWARD THE FILE..."); delay(2000); printf("\n\nSERVER FORWARD THE FILE..."); delay(2000); printf("\n\nSERVER FORWARD THE FILE..."); delay(2000); printf("\n\n\n CLIENT SIDE\n"); printf("\n-------------\n"); printf("\n\nTHE CONTANT OF THE %s FILE IS\n\n",fname); fp=fopen(fname,"r"); { if(fp==NULL) { printf("\n\nFILE NOT FOUND! ! ! !TRY AGAIN\n"); } else { while(!feof(fp)) { ch=getc(fp); printf("%c",ch); } } } fclose(fp); getch(); } |
||||