#include <stdio.h>
#include<stdlib.h>

// Note: We will make the password 2005

int main() {
    printf("\nWelcome to Mr. Lock system");

    int password;
    int FakeInput;

    printf("\n\nPlease type in your password...");
    
    scanf("%d", &password);
    
    if(password == 2005)
    {
        printf("\nThe password is correct : ");
        printf("\nHello my close friend : ");
    }    
    else
    {
        printf("\nThe password is wrong : ");
        printf("\nYou still have two more guesses :");
        printf("\nTry again");

        scanf("%d", &password);



        
        if(password == 2005)
        {
            printf("\nThe password is correct : ");
            printf("\nHello my close friend : ");
        }    
        else
        {
            printf("\nThe password is wrong : ");
            printf("\nYou still have one more guess :");

            printf("\nTry again");
            scanf("%d", &password);

        
            if(password == 2005)
            {
                printf("\nThe password is correct : ");
                printf("\nHello my close friend : ");
            }    
            else
            {
                printf("\nThe password is wrong : ");
                printf("\nYou still have 0 guesses left :");
            
            }
        }    
    }
    scanf("\n%d", &FakeInput);    
return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: