This Java code uses a while loop to print out the alphabet from a to z. It initializes a character variable ch to 'a' and loops while ch is less than or equal to 'z'. Inside the loop, it prints the character ch and then increments ch by 1, causing the loop to print each character sequentially from a to z.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
14 views1 page
Print Alphabet Using Java While Loop
This Java code uses a while loop to print out the alphabet from a to z. It initializes a character variable ch to 'a' and loops while ch is less than or equal to 'z'. Inside the loop, it prints the character ch and then increments ch by 1, causing the loop to print each character sequentially from a to z.