Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char likes_digging_for_treasure, can_swim;
- printf ("Do you like digging for treasure? (y/n).\n");
- scanf ("%c", &likes_digging_for_treasure);
- if (likes_digging_for_treasure == 'n' || likes_digging_for_treasure == 'N')
- {
- printf("You can't join the crew.\n");
- }
- if (likes_digging_for_treasure == 'y' || likes_digging_for_treasure == 'Y')
- {
- printf("Good.\n");
- printf ("Can you swim? (y/n).\n");
- scanf (" %c", &can_swim);
- }
- else
- {
- printf("Your input was invalid\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement