Program Password Sederhana

Bismillah..

Tutorial Program Password sederhana 🙂

1. Kode Program


#include <iostream>
using namespace std;

int main()
{
 char user[20];
 char pas[20];
 int banding1, banding2, ulang;
 cout <<"=================== Pemrograman C++ ===================== " <<endl;
 cout <<" Program Login " <<endl;
 cout <<"Nama : Nurfiah " <<endl;
 cout <<"NIM : 49013085 " <<endl;
 cout <<"---------------------------------------------------------" <<endl;
 cout <<endl;

for(ulang=0; ulang<3; ulang++){
 cout <<"Masukkan Username : ";
 cin>>user;
 cout <<"Masukkan Password : ";
 cin >>pas;

banding1=strcmp(user,"Nurfiah");
 banding2=strcmp(pas, "12345");
 cout <<"\n";
 if(banding1==0 && banding2==0){
 cout <<"User dan Password Anda Benar"<<endl;
 cout <<"Selamat Datang!!! " <<user<<endl;
 cout<<"\n";
 system("pause");
 return 0;

 }
 else{
 cout <<"Maaf User dan Password Anda Salah"<<endl;
 cout <<"Silahkan Coba lagi"<<endl;
 }

}
 cout <<"Maaf Akses Anda di Tolak" <<endl;
 system("pause");
 return 0;
}

Output Program :

login

2. Video Tutorial

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s