+ 1
What did I do wrong here?
#include<stdio.h> #include<string.h> void main() { char usr[20] = "admin"; char pwd[20] = "12345"; char usrIn[20], pwdIn[20]; printf("Enter username : "); gets(usrIn); printf("Enter Password : "); gets(pwdIn); if((strcmp(usr,usrIn)==0)&&(strcmp(pwd,pwdIn)==0)){ system("cls"); printf("\nyou are logged in\n"); } else { system("cls"); printf("\nusername or password is incorrect\n"); } }
3 Réponses
+ 3
Please mention the error type you are getting or the error .
+ 1
Well thanks RAJAN RAI
it was not displaying the true result in sololearn, but was working good in codeblocks.
I understood the mistake above was user input haha
+ 1
printf("...OKAY BUDDY...");