Monday, December 24, 2012

"Username & Password" (Contoh Program C++)

#include <iostream.h>
#include <conio.h>

main (void) {
int username, password;
int i;
printf("------------------------------------------\n");
printf("\tSelamat Datang Di Blog ku \n");
printf("------------------------------------------\n\n");
int user = 12345;
int pass = 12345;
i = 1;
do {
printf("Username : ");
scanf("%d",&username);
printf("Password : ");
scanf("%d",&password);

 if (username = user && password == pass) {
 printf("\n--------------------\n");
  printf("Anda Berhasil Login");
        printf("\n--------------------\n\n");
      } else {
        printf("\n------------------------\n");
        printf("Maaf ID & PASSWORD Salah!");
        printf("\n-------------------------\n\n");
         i = i +1;
      }
   }
   while (i <= 3);

   printf("Anda Telah 3x Memasukan ID & PASSWORD Yang Salah\n");
   printf("Mohon Maaf Akun Anda Kami Blockir, Terima Kasih..");

   getch();
   }   

SELAMAT MENCOBA!!

3 comments:

  1. thx kaka' sudah membantu tugas sya :)

    ReplyDelete
  2. for creating login in program
    first what we need to do is:
    1.register the data and safe in file txt using ifstream and outstream library
    2.then create a program for input and checking the username and pass has been you saved in file txt before..

    ;)

    ReplyDelete

Link