본문 바로가기

솔루션모음/쉽게 풀어 쓴 C언어 Express 실습문제17

[쉽게 풀어 쓴 C언어 Express] 13장 프로그래밍 programming 솔루션 답지 쉽게 풀어 쓴 C언어 express 솔루션입니다. 1. (a) #include struct point { int x, y; } ; int equal(struct point p1, struct point p2); int main(void) { struct point p1= { 1, 2 } ; struct point p2= { 3, 5 } ; printf("일치 여부 = %d\n", equal(p1, p2)); return 0; } int equal(struct point p1, struct point p2) { if( p1.x == p2.x && p1.y == p2.y ) return 1; else return 0; } (b) #include struct point { int x, y; } ; int qu.. 2020. 4. 11.
[쉽게 풀어 쓴 C언어 Express] 12장 프로그래밍 programming 솔루션 답지 쉽게 풀어 쓴 C언어 express 솔루션입니다. 1. #include int main(void) { char ch; printf("문자를 입력하시오: "); scanf("%c", &ch); printf("아스키 코드값=%d\n", ch); return 0; } 2. #include #include #define SIZE 100 void delete_space(char s[]) { char tmp[SIZE]; int i, k=0; for (i=0;i 2020. 4. 11.
[쉽게 풀어 쓴 C언어 Express] 11장 프로그래밍 programming 솔루션 답지 쉽게 풀어 쓴 C언어 express 솔루션입니다. 파일을 따로 준비해놨으니 필요하시다면 다운받아서 사용해주세요^^ 1. #include int main(void) { int x = 0x12345678; unsigned char *xp = (char *)&x; printf("바이트순서: %x %x %x %x\n", xp[0], xp[1], xp[2], xp[3]); return 0; } 바이트순서: 78 56 34 12 계속하려면 아무 키나 누르십시오 . . . 인텔 CPU는 리클 엔디안임을 알 수 있다. 2. #include void get_sum_diff(int x, int y, int *p_sum, int *p_diff); int main(void) { int sum=0, diff=0; get_sum.. 2020. 4. 11.
[쉽게 풀어 쓴 C언어 Express] 10장 프로그래밍 programming 솔루션 답지 1. #include int days[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } ; int main(void) { int i; for (i=0; i 2020. 4. 11.