Im a noob in C and I got this simple code working..
My problem is what if instead of "burke" its "burke jr." in str1[20] coz somehow i can get it working. >.< been studying C for almost a week now I hope you guys can help me. and give me some tip,hint and adviceCode:#include <stdio.h> #include <conio.h> #include <string.h> int main () { char str1[20]="burke",str2[20]; printf("Dog's name?:"); scanf("%s",str2); if (strcasecmp(str1, str2)==0){ printf("Gratz you got it",str2); } else{ printf("Wrong Answer!!!"); } getch(); }
im getting Wrong Answer.Code:#include <stdio.h> #include <conio.h> #include <string.h> int main () { char str1[20]="burke jr",str2[20]; printf("Dog's name?:"); scanf("%s",str2); if (strcasecmp(str1, str2)==0){ printf("Gratz you got it",str2); } else{ printf("Wrong Answer!!!"); } getch(); }



LinkBack URL
About LinkBacks



