Java : Problem - 05

 

Problem: -

  1. 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: -

Mj Mausam

Post a Comment

Previous Post Next Post