Hi all,
I am trying to work on a surprise for my boyfriend for Valentines. He is in computer programming so I want to write a little program scavenger hunt kinda thing for him.
To get started I want to have him enter his name. If it is his name it will allow him to continue and will say something like "hey you". If it is a different name it will say "invalid". I am having trouble getting it to work though.
Here is the code I have.
Code:#include <stdio.h> #include <string.h> int main() { char name[100]; printf("Enter your name: "); fgets(name, 100, stdin); if (strcmp(name, "Brandon")==0 ); { printf("hey youuu"); } else { printf("Invalid"); } return 0; }
Please help!