본문 바로가기

개발자 모드/C언어

C언어 아스키 코드 출력하기 기초

728x90
#include <stdio.h>

int main(void)
{

	// 아스키코드 출력하기
	// a : 97
	// A : 65
	// 0 : 48

	printf("%c\n", 'a');
	printf("%d\n", 'a');

	printf("%c\n", 'b');
	printf("%d\n", 'b');

	printf("%c\n", 'A');
	printf("%d\n", 'A');

	printf("%c\n", '\0');
	printf("%d\n", '\0');

	printf("%c\n", '0');
	printf("%d\n", '0');

	printf("%c\n", '1');
	printf("%d\n", '1');

	return 0;
}

 

 

 

728x90