Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. a
  2. ab
  3. abc
  4. abcd
  5. abcde
  6. abcdef
  7. abcdefg
  8. abcdefgh
  9. abcdefghi
  10. abcdefghij
  11. abcdefghijk
  12. abcdefghijkl
  13. abcdefghijklm
  14. abcdefghijklmn
  15. abcdefghijklmno
  16. abcdefghijklmnop
  17. abcdefghijklmnopq
  18. abcdefghijklmnopqr
  19. abcdefghijklmnopqrs
  20. abcdefghijklmnopqrst
  21. abcdefghijklmnopqrstu
  22. abcdefghijklmnopqrstuv
  23. abcdefghijklmnopqrstuvw
  24. abcdefghijklmnopqrstuvwx
  25. abcdefghijklmnopqrstuvwxy
  26. abcdefghijklmnopqrstuvwxyz
  27.  
  28. char ch;
  29. for( ch = 'a' ; ch <= 'z' ; ch++ )
  30. System.out.println(ch);
  31. System.out.println("Purple Loop");
  32.  
  33. StringBuilder line = new StringBuilder();
  34. for(char ch = 'a'; ch <= 'z'; ch++) {
  35. line.append(ch);
  36. System.out.println(line.toString());
  37. }
  38.  
  39. for (int i = 1; i <= 26; i++) {
  40. char ch = 'a';
  41. for (int j = 0; j < i; j++, ch++)
  42. System.out.print(ch);
  43. System.out.println();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement