Char + for Learn programming Java

Lesson:

Basic Data Types


Exercise:

Char + for 38


Objetive:

Create a program to write the letters "B" to "N" (uppercase), using "for"


Code:

public class Main
{
	public static void main(String[] args)
	{
		for (char i = 'B'; i <= 'N'; i++)
		{
			System.out.printf("%1$s ", i);
		}
		System.out.println();
	}
}