+ 1

Why is the output of this code error?

https://code.sololearn.com/cxl1cSPgFWnR/?ref=app

23rd May 2019, 4:15 PM
cody
cody - avatar
4 Answers
+ 3
Use strcmp() instead. https://code.sololearn.com/cAMTS01Thgzq/#c #include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int a; char name[20] = "cody"; a=1; if(strcmp(name, "cody") == 0 && a==1){ printf("\n its working"); } else{ printf("\n error"); } return 0; }
23rd May 2019, 4:23 PM
AgentSmith
+ 3
You're welcome! Best of luck in your learning.
23rd May 2019, 4:28 PM
AgentSmith
+ 2
Thank you Now it's working
23rd May 2019, 4:28 PM
cody
cody - avatar