C- Programming/변수와 자료형

C프로그램의 기본 구조 예

Iraphael 2014. 2. 12. 19:05

#include <stdio.h> //전처리기 지시 영역

/* c프로그램의 기본 구조를 보여주는 프로그램.

밑변이 4이고 높이가 5인 사각형의 면적구하기 */

int main()

{

//변수 선언

int area, width, height;


//자료 입력 : 여기서는 생략



//자료 처리

width = 4;

height = 5;

area = width * height;


//결과 출력

printf("면적 = %d \n", area);


return 0;

}


 실행결과