Tuesday, December 3, 2002

P R I N T A L P H A B E T S

package org.interview.test;

public class PrintAlphabets {

public static void main(String [] args) throws Exception {
char x = 'a';

for (x ='a'; x <= 'z' ; x++) {
System.out.print(x);
}
System.out.println();

char y = 'a';
while (y <= 'z') {
System.out.print(y);
y++;
}

System.out.println();

char c = 'a';
do {
System.out.print(c);
c++;
} while (c <= 'z');
}
}

No comments:

Post a Comment