Advertisement
Guest User

Untitled

a guest
Feb 17th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.    
  8.     int scanfunc;
  9.     int x;
  10.     printf( "What kind of Subnetting do you wish to do?\n1.)binary conversions\n2.)subnetting\n" );
  11.     scanf( "%d", &scanfunc );
  12.     if ( scanfunc ==1 ) {
  13.         do {
  14.             srand(time(NULL));
  15.             int rc;
  16.            
  17.             rc = (rand() % (255 + 1) + 1);
  18.             printf( "Your number is: %d", rc );
  19.             printf( "\nto create a new number press 1 and enter. To exit press 2 then enter\n" );
  20.             scanf( "%d", &x );
  21.         } while ( x == 1 );
  22.     }
  23.     else if ( scanfunc == 2 ) {
  24.         printf( "function not created yet 2" );
  25.     }
  26.     else {
  27.         printf( "You did not type a 1 or a 2" );
  28.     }
  29.     getchar();
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement