/*
Here a Simple Password Program in C Language .
Compile and Make the file with the name PASS.EXE
Copy this file to C:\ and
Open AUTOEXEC.BAT file and add the following lines
@PASS.EXE
A Simple Password Program Ready
*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int length,i,flag=0;
char a[][10]={"X","Y","Z","A"}; /*
Change the A , X , Y , Z to Your Passwords */
char again,stop;
char *p;
clrscr();
printf("\nEnter the Password :\n");
again:
{
fflush(stdin);
p=getpass("");
}
for(i=0;i<4;i++)
{
if(strcmpi(a[i],p)==0)
{
flag=1;
break;
}
}
if(flag==1)
{
goto stop;
}
else
{
clrscr();
printf("\nEnter the Password Again :\n");
goto again;
}
stop:
{
clrscr();
textcolor(15);
cprintf("\r\nAll the Birds are Safe in the Nest .\r\n");
}
if(strcmpi(a[1],p)==0)
{
clrscr();
textcolor(14);
cprintf("\r\nHi ! Mr.Y How are You ?\r\n");
}
if(strcmpi(a[0],p)==0)
{
clrscr();
textcolor(15);
cprintf("\r\nSuccess . . . OK\r\n");
}
}
|