This program will print all the character from a,b,c... upto z.
Java Program to print all alphabets(using for loop):
class alphabets
{
public static void main(String args[])
{
char ch;
for(ch='a';ch<='z';ch++)
{
System.out.println(ch);
}
}
}
Java Program to print all alphabets(using while loop):
class alphabets
{
public static void main(String args[])
{
char ch='a';
while(ch<='z')
{
System.out.println(ch);
ch++;
}
}
}
class alphabets
{
public static void main(String args[])
{
char ch='a';
do
{
System.out.println(ch);
ch++;
}
while(ch<='z');
}
}
Output of the program is:
Java Program to print all alphabets(using for loop):
class alphabets
{
public static void main(String args[])
{
char ch;
for(ch='a';ch<='z';ch++)
{
System.out.println(ch);
}
}
}
Java Program to print all alphabets(using while loop):
class alphabets
{
public static void main(String args[])
{
char ch='a';
while(ch<='z')
{
System.out.println(ch);
ch++;
}
}
}
Java Program to print all alphabets(using do while loop):
class alphabets
{
public static void main(String args[])
{
char ch='a';
do
{
System.out.println(ch);
ch++;
}
while(ch<='z');
}
}
Thanks for your informative post on Java application development. This open source platform assists software developers to create stunning mobile application with ease. Further, they can make use of this platform at free of cost.
ReplyDelete.Net Training in Chennai
PHP Training in Chennai
Big Data Training in Chennai
Very happy to see this blog. Gives a wonderful information with coded explanaion. Thank you for this blog. very useful to me.
ReplyDeleteDotnet Training in Chennai