본문 바로가기

Lobo's code station

hello.c

#include <stdio.h>

int main(void)
{
  printf("hello, world\n");
  
  return 0;
}

 

#include <stdio.h>

#앞에는 여백이 들어가면 안된다!줄의 맨앞은 #이 되어야 한다.
#printf함수를 사용하려면 include <stdio.h> 사용

 

#탭을 사용하면 4칸 스페이스와 같다.

 

printf("hello, world\n");

#printf에서 f는 format. 즉 형식을 지정해서 출력한다.
#c언어에서는 항상 ;로 끝마침한다.
#\n은 줄바꿈하는 기능!