progs/C6.c
changeset 478 6b7849a12d98
equal deleted inserted replaced
477:b2c5a721f360 478:6b7849a12d98
       
     1 #include <stdio.h>
       
     2 #include <string.h>
       
     3 
       
     4 int main(void)
       
     5 {
       
     6     char buff[15];
       
     7     int pass = 0;
       
     8 
       
     9     printf("\n Enter the password : \n");
       
    10     gets(buff);
       
    11 
       
    12     if(strcmp(buff, "thegeekstuff"))
       
    13     {
       
    14         printf ("\n Wrong Password \n");
       
    15     }
       
    16     else
       
    17     {
       
    18         printf ("\n Correct Password \n");
       
    19         pass = 1;
       
    20     }
       
    21 
       
    22     if(pass)
       
    23     {
       
    24        /* Now Give root or admin rights to user*/
       
    25         printf ("\n Root privileges given to the user \n");
       
    26     }
       
    27 
       
    28     return 0;
       
    29 }