Skip to content
Snippets Groups Projects
Commit d98125b3 authored by lbr's avatar lbr
Browse files

Numbers

parent 691d4fd9
No related branches found
No related tags found
1 merge request!1Numbers
...@@ -31,4 +31,28 @@ public class Main { ...@@ -31,4 +31,28 @@ public class Main {
} }
}; };
} }
}
\ No newline at end of file
public static void printNumberInWord(int number) {
String numberWord = switch (number) {
case 0 -> "ZERO";
case 1 -> "ONE";
case 2 -> "TWO";
case 3 -> "THREE";
case 4 -> "FOUR";
case 5 -> "FIVE";
case 6 -> "SIX";
case 7 -> "SEVEN";
case 8 -> "EIGHT";
case 9 -> "NINE";
default -> {
yield "OTHER";
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment