Gadgets

Monday, 23 November 2015

Display alphabets from A to Z


Display alphabets from ‘A’ to ‘Z’
public class Alphabets {
    public static void main(String[] arg){
        for(char ch=’A’;ch<=’Z’;ch++){
            System.out.print(ch+", ");
        }
    }    
}
 
Output:
D:\Java>java Alphabets
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
 

No comments:

Post a Comment