Answers for "login c++"

C++
1

login system with c++

//Written by itsKrish01
//If you find any error or mistake in this code, then please contact me.

#include <iostream>


using namespace std;

int main() {

  string login;
  string user;
  int login_times;
  string password_login;
  string password;
  
  string command;

  cout << "exit/login/register"<<endl<<"Command: ";
  cin >> command;

  while(command != "exit"){

    if(command == "register"){
      cout << "nn"<<endl;
      cout << "Registeration"<<endl<<"----------------"<<endl;
      cout <<"regsiter: ";
      cin >> user;
      cout <<"password: ";
      cin >> password; 

      cout << "nn";
      cout << "Registered Successfully!"<<endl;
      cout << "nn";
      cout << "exit/login/register"<<endl<<"Command: ";


      cin >> command;

      login_times = 3;
      while(login_times > 0){
        

        cout << "nn";
        cout << "Login"<<endl<<"_____";
        cout << "n";

        cout << "login: ";
        cin >> login;
        cout << "Password: ";
        cin >> password_login;

        

        

        if(login == user && password_login == password){
          cout << "loged in Successfully!"<<endl;
          cout << "Welcome"<<user<<"!";
          
          break;

        }
        else if(login != user && password_login == password){

          cout << "username is incorrect!"<<endl;
          login_times--;
          
        }

        else if(login == user && password_login != password){

          cout << "password is incorrect!"<<endl;
          login_times--;
          
        }
        else{
          cout << "Everything is incorrect!"<<endl;
          login_times--;
        }

        

        


      }
      cout << "you have entered wrong details for more than 3 times, So we have blocked your account!";
      break;
    }

  }

}
Posted by: Guest on October-26-2021
0

log in c++

#include <cmath>
log(number)
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language