3i Infotech Placement: Sample Questions 744 - 745 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 744

Edit

Describe in Detail

Essay▾

Write a macro for swapping integers.

Explanation

  1. #include<iostream.h>
  2. #include<conio.h>
  3. #defineSWAP(a,b) {inttemp; temp=a; a=b; b=temp;}
  4. voidmain()
  5. {
  6.     clrscr();
  7.     intx,y;
  8.     cout≪“Entertwonumbers:”;
  9.     cinxy;
  10.     cout≪“x=”≪x≪” y=”≪y;
  11.     SWAP(x,y);
  12.     cout≪“nx=”≪x≪” y=”≪y;
  13.     getch();
  14. }

Question 745

Edit

Describe in Detail

Essay▾

What is RIP (Routing Information Protocol) ?

Explanation

  • RIP is one of the oldest distance-vector routing protocol employing hop count routing metric- Hop is the step towards the next existing device- a router, computer or any device
  • Used for exchanging information between the routers.
  • Simple vector routing protocol with many existing implementations
  • Used in both local and wide area networks
  • Easily configured and implemented.

How Does RIP Work?

  • Each router initializes its routing table with a list of locally connected networks.
  • Every router advertises the contents of its routing table over all the RIP enabled interfaces.
  • Each route has a property called a metric indicating “distance” to the route՚s destination.
  • When router detects change in routing table- it sends an immediate “triggered” update.
  • Request message allows a newly started router to rapidly query all of its neighbour՚s routing tables.
  • When router “A” learns a route from router “B” it advertises the route back to “B” with a metric of 16 ensuring that “B” is never under the impression that “A” has a different way of getting to the same destination.

Developed by: