JAVA 03강 연산자(Operator)/03강 연산자 커스텀예제

03장 연산자 커스텀 예제

ByeongSuAhn 2021. 7. 17. 06:16
public class radi {
	public static void main(String[] args) {
		int rad = 3;
		System.out.println(Math.PI);
		System.out.printf("원 둘레는 : %fcm%n" , Math.PI *2*rad);
		System.out.printf("원 넓이는 : %fcm^2%n" , Math.PI *rad*rad);
	}
}
원 둘레는 : 18.849556cm
원 넓이는 : 28.274334cm^2
저작자표시 비영리 (새창열림)