You can try the below code , it will run perfectly
I am modify your code & following are some mistakes in your code !
1) You can use the wrong data type , the password & username are not integer data type .They should be in string formats.
2) You take the input in variable 'username' & 'password' then you code overwrite these variable with the uninitialized variable 'User' & 'Pass'.
3) Then your code compare the username & password variable values with the uninitialized values of 'User' & 'Pass' .
#include <iostream>
#include <string>
#include<conio.h>
using namespace std;
int main() {
string username, password, User="usman", Pass="12345";
//username variable is used to take input from the user
//password variable is used to take input from the user
//User variable has the hardcode value of username 'usman' which is used to compare in if condition
//Pass variable has the hardcode value of password '12345' which is used to compare in if condition
//taking username from user through keyboard in 'username' variable
std::cout << "enter username: " << std::endl;
std::cin >> username;
//taking password from user through keyboard in 'password' variable
std::cout << "enter password: " << std::endl;
std::cin >> password;
//Now compare the 'username' & 'password' variable value with the hardcode values of 'User' & 'Pass'
if (username != User && password != Pass)
{
std::cout << "error";
}
if (username == User && password != Pass)
{
std::cout << "error";
}
if (username != User && password == Pass)
{
std::cout << "error";
}
if (username == User && password == Pass)
{
std::cout << "success";
}
_getch();
return 0;
}

