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');
}
}
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