Program Password Sederhana
#include<stdio.h>#include<conio.h>
#include<string.h>
void main()
{
char username[25],password[12],pwd[12];
char ch;
int i;
while (1)
{
clrscr();
printf("\nUser name :");gets(username);
printf("\nPassword:");
i=-1;
do
{
i=i+1;
ch=getch();
if(ch!=13)
{
pwd[i]=ch;
}
printf("*");
}while(int(ch)!=13);
strcpy(password,pwd);
if((strcmp(username,"daku")==0)&&(strcmp(password,"sigit")==0))
{
printf("\nUsername dan password OK!!!");
getch();
break;
}
else
{
printf("\nUsername Or password invalid !!!");
printf("\nSilahkan Ulangi !!!");
getch();
}
}
}
Label:
Bahasa C
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar