Monday, 25 November 2013

Program Login di C++



#include
#include
#include
#include

using namespace std;

main () {
    char username[10];
    int password;

    int i = 3;
    do {
        cout << "Kesempatan login : " << i;
        i--;
        cout << "\nMasukkan username : ";
        cin >> username;
        cout << "Masukkan password : ";
        cin >> password;
        if (strcmp(username, "admin")==0 && password==613134022 || password==613134021 || password==613134024)
            {cout << "Anda Berhasil Login";
            goto datang;}
        else
            cout << "Username atau Password salah silahkan coba lagi";
        cout << "\n\n";

    }while(i>=1);
    cout << "Kesempatan login anda habis";
    exit(0);
    datang:
        cout << "\nSemalat Datang";
getch();
return 0;
}
Previous Post
Next Post

0 komentar: