2018-05-05 23:19:22 +01:00

28 lines
679 B
C

#include<stdio.h>
int main(int argc, const char *argv[])
{
char String[] = "1453g5a24";
char *At = String;
while(*At)
{
char c = *At;
// Complete this Switch-Statement to print out the numbers to 5 in words
// Characters should just be printed out as is. (use the default keyword instead of the case keyword)
// Also fix the bug that is already in the code.
switch(c) // This defines the expression we are going to switch on.
{
case '1': // The case keywords defines the starting point for code execution
{
printf("One ");
}
case '2':
{
printf("Two ");
}break; // The break stops the program to execute the next case
}
At++;
}
}