국비지원 JAVA 풀스택 과정/JAVA

[JAVA] 영문 대문자, 영문 소문자를 출력하기

ODaram 2022. 9. 29. 15:51
영문 대문자, 영문 소문자를 출력하기

 

영문 대문자, 영문 소문자를 출력하세요.

영문 대문자 65~90 숫자로 이루어져 있다. 숫자 사이의 간격은 1이다.
영문 소문자 97~122 숫자로 이루어져 있다. 숫자 사이의 간격은 1이다.

 

package com.dream.controls;

public class ForEx04_1 {
	public static void main(String[] args) {
		System.out.println("\n\t--- 대문자 출력---");
		for(int i=65; i<=90; i++) {
			System.out.print("\t"+(char)i);
		}
		System.out.println("\n\t--- 소문자 출력---");
		for(int i=97; i<=122; i++) {
			System.out.printf("\t"+(char)i);
		}
        
	}
}