Last active
April 4, 2019 19:06
-
-
Save anonur/23cd0d52883feb60cdecb52729db5f51 to your computer and use it in GitHub Desktop.
Sums integers while user enters 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| int main() | |
| { | |
| int x; | |
| printf("Enter a one digit integer: "); | |
| scanf("%d",&x); | |
| switch(x) | |
| { | |
| case 1: printf("\nOne.");break; | |
| case 2: printf("\nTwo.");break; | |
| case 3: printf("\nThree.");break; | |
| case 4: printf("\nFour.");break; | |
| case 5: printf("\nFive.");break; | |
| case 6: printf("\nSix.");break; | |
| case 7: printf("\nSeven.");break; | |
| case 8: printf("\nEight.");break; | |
| case 9: printf ("\nNine.");break; | |
| default: printf("\nThis integer isn't one digit..."); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment