Pageviews

Sunday 18 August 2013

Java Program to print alphabets

by Unknown  |  in Source Codes at  Sunday, August 18, 2013

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++;
}

}



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

}

Output of the program is:

Alphabets

2 comments:

  1. 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.
    .Net Training in Chennai
    PHP Training in Chennai
    Big Data Training in Chennai

    ReplyDelete
  2. Very happy to see this blog. Gives a wonderful information with coded explanaion. Thank you for this blog. very useful to me.
    Dotnet Training in Chennai

    ReplyDelete

Proudly Powered by Blogger.