Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main(){
- char username[6]= "fantio", pass[9]= "fantio123";
- char usr[6], pas[9];
- int status = 0, salah = 0;
- while(status < 3){
- printf("------------- LOGIN ---------------\n");
- printf("Masukkan Username : ");
- gets(usr);
- printf("Masukkan Password : ");
- gets(pas);
- if(strcmp(username, "fantio")==0 && strcmp (pass, "fantio123")== 0){
- printf("Akses diterima. Selamat Datang\n");
- break;
- }else{
- printf("Maaf, username atau Password anda salah\n");
- salah++;
- if(salah == 3){
- printf("Akses ditolak\n");
- }
- }
- status++;
- }
- printf ("Anda telah 3x memasukan Username & Password yang salah.\n");
- printf ("Mohon maaf akun anda kami blokir untuk sementara. \n");
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment