#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("User Name:");gets(username);
printf("password:");
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,"Ardhy")==0))
{
printf("\n\nUsername OK !!");
getch( );
}
else
{
printf("\n\nUsername invalid !!\n");
printf("Silahkan Ulangi !!!");
getch( );
}
if((strcmp(password,"888")==0))
{
printf("\n\npassword OK !!");
getch( );
break;
}
else
{
printf("\n\npassword invalid !!!");
printf("\nSilahkan Ulangi !!!");
getch( );
}
getch( );
}
}
//dalam program diatas saya menggunakan username : Ardhy dan password : 888
#include<conio.h>
#include<string.h>
void main( )
{
char username[25],password[12],pwd[12];
char ch;
int i;
while(1)
{
clrscr( );
printf("User Name:");gets(username);
printf("password:");
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,"Ardhy")==0))
{
printf("\n\nUsername OK !!");
getch( );
}
else
{
printf("\n\nUsername invalid !!\n");
printf("Silahkan Ulangi !!!");
getch( );
}
if((strcmp(password,"888")==0))
{
printf("\n\npassword OK !!");
getch( );
break;
}
else
{
printf("\n\npassword invalid !!!");
printf("\nSilahkan Ulangi !!!");
getch( );
}
getch( );
}
}
//dalam program diatas saya menggunakan username : Ardhy dan password : 888
0 komentar:
Posting Komentar