#include<stdio.h>
int main(){
char user = "welcome";
printf("Enter UserName \n");
scanf("%s",&user);
char pass = "hi";
printf("Enter Password: \n");
scanf("%s",&pass);
if(user=="welcome" && pass == "hi"){
printf("Login Successful");
}
else{
printf("Retry");
}
return 0;
}
This program asks to enter username and password then checks if entered correctly and prints suitable statement.
However, for me it only shows else part even if the data entered is correct.