728x90 반응형 SMALL 개념/혼자 공부하는 C언어35 chapter 2 ) 세 가지 진법의 정수 상수 #include int main(void){ printf("%d\n", 12); printf("%d\n", 014); printf("%d\n",0xc); return 0; } 코드 설명 1. main() 1-1. printf() 문을 3번 사용하여 10진수, 8진수, 16진수를 모두 10진수(12)로 변환한다. 2. 반환문 (return) 작 2024. 5. 31. chapter 2) 문자와 문자열 데이터 출 #include int main(void){ printf("%c\n", 'A'); printf("%s\n", "A"); printf("%c -> %s.\n", '1',"first"); return 0; } 코드 설명 1, main()함수 1-1. printf() 문을 3번 사용하여 각각 문자 A, 'A', 1 -> "first"를 출력함 1-2. 반환 값(return) 작성 2024. 5. 30. chapter 2 ) 문자열을 화면에 출력하는 프로그램 #include void main(void){ printf("Be happy!"); printf("My friend"); return 0; } 코드 설명 : 1. main() 함수 1-1. printf() 문을 2줄 반복해서 각각 Be happy, My friend를 출력하도록 함 2. 반환 값 (return 0) 작성 2024. 5. 26. 이전 1 ··· 6 7 8 9 다음 728x90 반응형 LIST