Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ch12 {
- public static void main(String[] args){
- writeStars(25);
- }
- public static void writeStars(int n){
- if (n == 0){
- // base case
- System.out.println();
- } else {
- // recursive case
- System.out.print("*");
- writeStars(n - 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement