A little trouble with my username/password program

This code was supposed to check 2 usernames and password matches but I want it to be able to say if either the username or password is wrong which is near the bottom of the code. can someone tell me how I can fix the bottom if statement
[code]

[/c#include <iostream>
#include <string>
using namespace std;


int main ()
{
string username;
string password;

cout << "Please Enter your Username: " << "\n";
cin >> username;

cout << "Please enter your password" << "\n";
cin >> password;

if (username == "apple" && password == "1234") {
cout << "hi apple\n";
}

else
if (username == "android" && password == "4321")
{
cout << "hi android";
}
else if (!(username =="apple" || "android") && (password == "1234" || "4321") )
{
cout << "wrong username or password";
}

}
else if (!(username =="apple" || username == "android") && (password == "1234" || password == "4321") )
I tried your code to replace my else if statement but it would still not execute the cout the program will just end when i click enter after putting in the wrong password
Topic archived. No new replies allowed.