0

What is wrong with this code?

#include <stdio.h> int main() { char favoriteDairyProduct[30]; scanf("%s",favourteDairyProduct); if (strcmp(favoriteDairyProduct, "cheese") == 0) { printf("You like cheese too!"); } else { printf("I like cheese more."); } } return 0; }

12th Jun 2022, 7:49 AM
JUDESON JOBY
JUDESON JOBY - avatar
2 Answers
+ 3
There is a typographical error in the array name on line 4. There is an extra closing brace after the else clause.
12th Jun 2022, 8:16 AM
Brian
Brian - avatar
+ 1
Ok tnx
14th Jun 2022, 12:12 AM
JUDESON JOBY
JUDESON JOBY - avatar