Java/Java practice
[자바] 사각형 넓이 구하기
praybe
2021. 10. 29. 19:08
가로와 세로를 담는 변수 선언.
해당 변수에 임의 가로, 세로 값 할당
넓이를 담는 변수 선언 후 해당 넓이 출력
public class PraybeBlog {
public static void main(String[] args) {
int width;
int height;
width = 28;
height = 14;
int area = width * height;
System.out.println(area);
}
}
