- #1
ksepe
- 5
- 0
I am trying to compare a computer generated word to display the following however, when Quit is entered it produces the output "Hello". What is my error in the code?
Code:
#include <stdio.h>
#include <string.h>
int main(void) {
char userString[50];
strcpy(userString, "Quit");
/* Your solution goes here */
if (strcpy(userString,"Quit")==0){
printf("Goodbye\n");
}
else {
printf("Hello\n");
}
return 0;
}
Last edited by a moderator: