Amazon banner

Sunday, 16 September 2012

PROGRAM TO GENERATE IP ADDRESSES


/***********************************************************************/
/* PROGRAM TO GENERATE IP ADDRESSES                                    */
/* AUTHOR : DEEPAK MAHAKALE 3 YEAR IT SRCOEM                           */
/* BLOG : www.mahakaledeepak.blogspot.com                              */
/***********************************************************************/
#include<stdio.h>
#include<conio.h>
void main() {
  int n1, n2, n3, n4, i, j, k, l, m, cnt = 0, a[50];
  clrscr();
  printf("\n\t* IP ADDRESSES ALLOTTED TO RCOEM * ");

  for (i = 5; i < 50; i++) {
    n1 = i;
    for (j = 1; j < 255; j++) {
      n2 = j;
      for (k = 5; k < 50; k++) {
        n3 = k;
        for (l = 1; l < 255; l++) {
          n4 = l;
          if (n1 + n3 <= 50) {
            if (n1 % n4 == 0 && n3 % n4 == 0) {
              m = 1;
              a[3] = 1000, cnt = 0;
              while (m < 10) {
                if (n4 % m == 0) {
                  a[++cnt] = m;
                }
                m++;
              }
              if (n2 == a[3] && n2 != n4) {
                {
                  printf("\n\t %d.%d.%d.%d", n1, n2, n3, n4);
                }
              }
            }
          }
        }
      }
    }
  }
  getch();
}

No comments:

Post a Comment