Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- unsigned char c;
- printf("Welcome to the game console selection helpdesk!\nDo you like video games? (y/n) ");
- c = getchar(); getchar();
- printf("You entered: '%c'\n", c);
- if (c == 'n') {
- printf("Our advise: buy a PC\n");
- }
- else if (c == 'y') {
- printf("Do you have any friends? (y/n) ");
- c = getchar(); getchar();
- printf("You entered: '%c'\n", c);
- if (c == 'n') {
- printf("Our advise: buy a PS3\n");
- }
- else if (c == 'y') {
- printf("Do you ever meet your friends off-line? (y/n) ");
- c = getchar(); getchar();
- printf("You entered: '%c'\n", c);
- if (c == 'n') {
- printf("Our advise: buy a Xbox360\n");
- }
- else if (c == 'y') {
- printf("Our advise: buy a Wii\n");
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement