progs/C6.c
author cu
Wed, 18 Oct 2017 14:38:25 +0100 (2017-10-18)
changeset 552 c1e9a435e16f
parent 478 6b7849a12d98
permissions -rw-r--r--
updated
#include <stdio.h>
#include <string.h>

int main(void)
{
    char buff[15];
    int pass = 0;

    printf("\n Enter the password : \n");
    gets(buff);

    if(strcmp(buff, "thegeekstuff"))
    {
        printf ("\n Wrong Password \n");
    }
    else
    {
        printf ("\n Correct Password \n");
        pass = 1;
    }

    if(pass)
    {
       /* Now Give root or admin rights to user*/
        printf ("\n Root privileges given to the user \n");
    }

    return 0;
}