Advertisement
Rochet2

Untitled

Mar 11th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. main ()
  5. {
  6.     int  logggedIN[] = {1, 6, 10, 15, 100, 77, 500};
  7.     int  loginID[] = {1, 10, 100, 500};
  8.     int  itterate;
  9.     int  idSearch;
  10.     int  found = 0;
  11.  
  12.     printf("Admin interface - Type in your User ID to Login: ");
  13.     scanf("%d", &idSearch);
  14.  
  15.  
  16.     /*--------------------------------------------------------------
  17.  
  18.     IF Statements
  19.     ****************************************************************/
  20.     for (itterate = 0; itterate < 4; itterate++) // itterate++ is run every time
  21.     {
  22.         if (idSearch == loginID[itterate])
  23.         {
  24.             found = 1;
  25.             break;
  26.         }
  27.     }
  28.  
  29.     if (found)
  30.     {
  31.         if (idSearch == 10)
  32.         {
  33.             printf("Welcome  Administrator: %d", idSearch);
  34.         }
  35.     }
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement