Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- // we can use char in switch statement because chars are ascii value.
- int main(void)
- {
- int goat_count;
- // char c = 'b';
- printf("Enter a goat count: ");
- scanf("%d", &goat_count);
- // Read an integer from the keyboard
- // printf("%d\n", (int)c);
- switch (goat_count) {
- case 0:
- printf("You have no goats.\n");
- break;
- case 1:
- printf("You have a singular goat.\n");
- break;
- case 2:
- printf("You have a brace of goats.\n");
- break;
- default:
- printf("You have a bona fide plethora of goats!\n");
- break;
- }
- printf("double");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement