Problem: -
- Write a program to print Alphabet (A to Z) using loop.
Solution: -
1. Write a program to print Alphabet (A to Z) using loop.
class alphabet {
public static void main(String args[]) {
char a = 'A';
for (int i=1; i<=26; i++) {
System.out.println(a);
a++;
}
}
}
Output: -
Tags
Java