Similar documents
Java

: 1 int arr[9]; int n, i; printf(" : "); scanf("%d", &n); : : for(i=1; i<10; i++) arr[i-1] = n * i; for(i=0; i<9; i++) if(i%2 == 1) print

歯9장.PDF

untitled


untitled

chap7.key

13주-14주proc.PDF

03장.스택.key

중간고사

untitled

int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \

PowerPoint 프레젠테이션

Microsoft PowerPoint - chap05-제어문.pptx

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

Microsoft PowerPoint - chap13-입출력라이브러리.pptx

Chapter_06

C 언어 프로그래밊 과제 풀이

C 프로그래밊 개요

untitled

, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float

歯7장.PDF

chap7.PDF

C++-¿Ïº®Çؼ³10Àå

11장 포인터

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7>

PowerPoint 프레젠테이션

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

Line (A) å j a k= i k #define max(a, b) (((a) >= (b))? (a) : (b)) long MaxSubseqSum0(int A[], unsigned Left, unsigned Right) { int Center, i; long Max

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾

본 강의에 들어가기 전

01....b

(291)본문7

¾Ë·¹¸£±âÁöħ¼�1-ÃÖÁ¾

2007백서-001-특집

00목차

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

PowerPoint 프레젠테이션

K&R2 Reference Manual 번역본


5.스택(강의자료).key

BMP 파일 처리

Chapter 4. LISTS

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2

chap8.PDF

3. 1 포인터란 3. 2 포인터변수의선언과사용 3. 3 다차원포인터변수의선언과사용 3. 4 주소의가감산 3. 5 함수포인터

PowerPoint 프레젠테이션

untitled

Microsoft PowerPoint - chap12-고급기능.pptx

59

02장.배열과 클래스

연습문제만-수정

PowerPoint 프레젠테이션

<C1DFB0EDB5EEBACE2E687770>

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

Chapter 4. LISTS

13 주차문자열의표현과입출력

Microsoft PowerPoint - chap11.ppt [호환 모드]

PowerPoint 프레젠테이션

슬라이드 1

; struct point p[10] = {{1, 2, {5, -3, {-3, 5, {-6, -2, {2, 2, {-3, -3, {-9, 2, {7, 8, {-6, 4, {8, -5; for (i = 0; i < 10; i++){ if (p[i].x > 0 && p[i



자식농사웹완

chungo_story_2013.pdf

*중1부

2

Çѱ¹ÀÇ ¼º°øº¥Ã³µµÅ¥

...._


전반부-pdf

표1.4출력

003-p.ps

<4D F736F F F696E74202D20312E20B0E6C1A6C0FCB8C15F3136B3E2C7CFB9DDB1E25F325FC6ED28C0BA292E >

_

12월월간보고서내지편집3

중앙도서관소식지겨울내지33

에너지포커스 2007년 가을호


01_당선자공약_서울

인권문예대회_작품집4-2




목차

A°ø¸ðÀü ³»Áö1-¼öÁ¤

±¹³»°æÁ¦ º¹»ç1

¿¡³ÊÁö ÀÚ¿ø-Âü°í ³»Áö.PDF

전반부-pdf

뉴스레터6호

Microsoft PowerPoint 하반기 크레딧 전망_V3.pptx

50차 본문 최종

양성내지b72뼈訪?303逞

³»Áöc03âš

Transcription:

http://cafedaumnet/pway

Chapter 1

Chapter 2 21 printf("this is my first program\n"); printf("\n"); printf("-------------------------\n"); printf("this is my second program\n"); printf("-------------------------\n"); 22 int a, b, c; a = 1; b = 2; c = a + b; printf("a=%d b=%d c=%d\n", a, b, c); 23 int a, b, c; printf("please enter two numbers:");

scanf("%d %d", &a, &b); c = a + b; printf("\na=%d b=%d c=%d", a, b, c); 24 int i, n; printf("\nplease enter number:"); scanf("%d", &n); printf("\n"); printf("yes "); printf("\n print %d many yes",n); int i, n; printf("\nplease enter number:"); scanf("%d", &n); printf("\n"); printf("%d", i); printf("\n print the numbers from 0 to %d", n-1); 241 for 1 for(i=0;i<10;i++) printf("yes "); for(i=0;i<100;i++) printf("happy "); for(i=0;i<1000;i++) printf("laugh "); 242 for 2

printf("yes "); 0 i=0; 1 i<n; 0<3, 2 printf("yes "); 3 i++ i 1 i=1 4 i<n; 1<3, 5 printf("yes "); 6 i++ i 1 i=2 7 i<n; 2<3, 8 printf("yes "); 9 i++ i 1 i=3 10 i<n; 3<3, 11 for 243 for 3 printf("yes "); for( ; ; ) 244 for 4 printf("%d", i); 0 i=0; 1 i<n; 0<3, 2 printf("%d", i); 0 3 i++ i 1 i=1 4 i<n; 1<3, 5 printf("%d", i); 1 6 i++ i 1 i=2 7 i<n; 2<3, 8 printf("%d", i); 2 9 i++ i 1 i=3

10 i<n; 3<3, 11 for 25 int i, n; printf("\nplease enter number:"); scanf("%d", &n); printf("%d", i+1); int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) printf("%4d", j+1); printf("\n"); 251 for 5 1 2 3 4 int i, j, n; 5 6 printf("\nplease enter number:"); 7 scanf("%d", &n); 9 10 11 12 for(j=0;j<n;j++) 13 printf("%4d", j+1); 14 printf("\n"); 15 16 17 : for?

: 10 11 15 : 5? : C ( ) : for? : for for :? : 252 for 6 1 2 3 4 int i, j, n; 5 6 printf("\nplease enter number:"); 7 scanf("%d", &n); 9 10 11 12 for(j=0;j<n;j++) 13 printf("%4d", j+1); 14 printf("\n"); 15 16 17 10 for : i=0 i 0 : i<3 : 11-15 12 for : j=0 j 0 : j<3 : printf("%4d", j+1); 1 : j++ j 1 : j<3 : printf("%4d", j+1); 2 : j++ j 2 : j<3 : printf("%4d", j+1); 3 : j++ j 3 j<3 for (12 ) 14 printf("\n"); (11-15 ) : i++ i 1 : i<3 : 11-15 12 for

: j=0 j 0 : j<3 : printf("%4d", j+1); 1 : j++ j 1 : j<3 : printf("%4d", j+1); 2 : j++ j 2 : j<3 : printf("%4d", j+1); 3 : j++ j 3 j<3 for (12 ) 14 printf("\n"); (11-15 ) : i++ i 2 : i<3 : 11-15 12 for : j=0 j 0 : j<3 : printf("%4d", j+1); 1 : j++ j 1 : j<3 : printf("%4d", j+1); 2 : j++ j 2 : j<3 : printf("%4d", j+1); 3 : j++ j 3 j<3 for (12 ) 14 printf("\n"); (11-15 ) : i++ i 3 : i<3 for (10 ) 1 2 3 1 2 3 1 2 3 26 int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) printf("%4d", j+1); printf("\n");

27 int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); k = 1; for(j=0;j<n;j++) printf("%4d", k++); printf("\n"); 28 int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<i+1;j++) printf("%4d", j+1); printf("\n"); int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n-i;j++) printf("%4d", j+1); printf("\n");

281 for 7 1 2 3 4 int i, j, k, n; 5 6 printf("\nplease enter number:"); 7 scanf("%d", &n); 9 10 k=1; 11 12 13 for(j=0;j<n;j++) 14 printf("%4d", k++); 15 printf("\n"); 16 17 18 10 k=1; k 1 11 for : i=0 i 0 : i<3 : 12-16 13 for : j=0 j 0 : j<3 : printf("%4d", k++); 1 k 2 : j++ j 1 : j<3 : printf("%4d", k++); 2 k 3 : j++ j 2 : j<3 : printf("%4d", k++); 3 k 4 : j++ j 3 j<3 for (13 ) 15 printf("\n"); (12-16 ) : i++ i 1 : i<3 : 12-16 13 for : j=0 j 0 : j<3 : printf("%4d", k++); 4 k 5 : j++ j 1 : j<3 : printf("%4d", k++); 5 k 6 : j++ j 2 : j<3 : printf("%4d", k++); 6 k 7 : j++ j 3 j<3 for (13 )

15 printf("\n"); (12-16 ) : i++ i 2 : i<3 : 12-16 13 for : j=0 j 0 : j<3 : printf("%4d", k++); 7 k 8 : j++ j 1 : j<3 : printf("%4d", k++); 8 k 9 : j++ j 2 : j<3 : printf("%4d", k++); 9 k 10 : j++ j 3 j<3 for (13 ) 15 printf("\n"); (12-16 ) : i++ i 3 : i<3 for (11 ) 1 2 3 4 5 6 7 8 9 282 for 8 1 2 3 4 int i, j, n; 5 6 printf("\nplease enter number:"); 7 scanf("%d", &n); 8 9 10 11 for(j=0;j<i+1;j++) 12 printf("%4d", j+1); 13 printf("\n"); 14 15 16

1 1 2 1 2 3 283 for 9 1 2 3 4 int i, j, n; 5 6 printf("\nplease enter number:"); 7 scanf("%d", &n); 8 9 10 11 for(j=0;j<n-i;j++) 12 printf("%4d", j+1); 13 printf("\n"); 14 15 16 1 2 3 1 2 1

Chapter 3

Chapter 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 21 22 23 24 25 16 17 18 19 20 11 12 13 14 15 6 7 8 9 10 1 2 3 4 5 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 1 2 3 4 5 2 3 4 5 1 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Chapter 5 ***** ***** ***** ***** ***** * ** *** **** ***** * ** *** **** ***** * *** ***** ******* ********* * *** ***** ******* ********* ******* ***** *** *

* * *** *** ***** ***** ******* ******* ****************** ******* ******* ***** ***** *** *** * * [ n, 2-8 ] * ********* * *** *********** *** ***** ************* ***** ******* *************** ******* *********************************** [ 2*n ] * *** ***** ******* ********* * *********** * *** ************* *** ***** *************** ***** ******* ***************** ******* ************************************* $$$$$$$ $*****$ $*****$ $*****$ $*****$ $*****$ $$$$$$$ [ n+2 + n+1 = 2*n + 3 ] [ *2 ] [ *1 ] * ** *@* *@@* *@@@* *@@@@* *@@@@@* *@@@@* *@@@* *@@* *@* ** *

int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) printf("*"); printf("\n");

Chapter 6 61 int a[30][30]; int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); k=0; for(j=0;j<n;j++) a[i][j] = k++; for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n");

611 1 1 2 3 ( ) 4 5 a[ 0][ 0], a[ 0][ 1], a[ 0][ 2], a[ 0][ 3],,,, a[ 0][28], a[ 0][29], a[ 1][ 0], a[ 1][ 1], a[ 1][ 2], a[ 1][ 3],,,, a[ 1][28], a[ 1][29], a[ 2][ 0], a[ 2][ 1], a[ 2][ 2], a[ 2][ 3],,,, a[ 2][28], a[ 2][29], a[29][ 0], a[29][ 1], a[29][ 2], a[29][ 3],,,, a[29][28], a[29][29] 612 2 1 2 3 4 int a[30][30]; 5 int i, j, k, n; 6 7 printf("\nplease enter number:"); 8 scanf("%d", &n); 9 10 k=0; 11 12 for(j=0;j<n;j++) 13 a[i][j] = k++; 14 15 16 17 for(j=0;j<n;j++) 18 printf("%4d", a[i][j]); 19 printf("\n"); 20

21 22 62 int a[30][30]; int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) a[i][j]=j+1; // [A] for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n"); : a[i][j]=i+1; : a[i][j]=i+j+1; : a[i][j]=i-j; : a[i][j]=j-i; : a[i][j]=(i+1)*(j+1); 63 int a[30][30]=0,; int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); a[i][i]=i+1; // [A] for(j=0;j<n;j++)

printf("%4d", a[i][j]); printf("\n"); : a[i][i]=n-i; : a[0][i]=i+1; : a[n-1][i]=i+1; : a[i][0]=i+i; : a[i][n-1]=i+1; : a[i][n-i-1]=i+1; 64 int a[30][30]=0,; int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); k=0; a[i][i]=k++; // [A] for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n"); : a[0][i]=k++; : a[n-1][i]=k++; : a[i][0]=k++; : a[i][n-1]=k++; : a[i][n-i-1]=k++; : a[n-i-1][i]=k++; 65 int a[30][30]=0,; int i, j, k, n; printf("\nplease enter number:"); scanf("%d", &n); k=0;

for(j=0;j<n;j++) a[i][j]=k++; // [A] for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n"); : a[j][i]=k++; : a[i][n-j-1]=k++; : a[n-i-1][j]=k++; : a[n-i-1][n-j-1]=k++; : a[j][n-i-1]=k++; : a[n-j-1][i]=k++; 66 int i, n; printf("\nplease enter number:"); scanf("%d", &n); if((i%2)==0) printf("\ni=%d is even number", i); else printf("\ni=%d is odd number", i); // // 67 int a[30][30]; int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) if(i==j) a[i][j]=9; else a[i][j]=1;

for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n"); 9 1 1 1 1 1 9 1 1 1 1 1 9 1 1 1 1 1 9 1 1 1 1 1 9 int a[30][30]; int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<n;j++) if(i>j) a[i][j]=9; else a[i][j]=1; for(j=0;j<n;j++) printf("%4d", a[i][j]); printf("\n"); 1 1 1 1 1 9 1 1 1 1 9 9 1 1 1 9 9 9 1 1 9 9 9 9 1 if((i%2)==0) % i%2 i 2 i 0, 1 if((i%2)==0) i

Chapter 7 (2 ) number = 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 number = 5 1 6 11 16 21 2 7 12 17 22 3 8 13 18 23 4 9 14 19 24 5 10 15 20 25 number = 5 21 22 23 24 25 16 17 18 19 20 11 12 13 14 15 6 7 8 9 10 1 2 3 4 5 number = 5 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 23 24 25 number = 7 9 9 9 9 9 9 9 9 9 0 0 0 9 9 9 0 9 0 9 0 9 9 0 0 9 0 0 9 9 0 9 0 9 0 9 9 9 0 0 0 9 9 9 9 9 9 9 9 9

number = 5 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 number = 6 1 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 number = 6 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 number = 5 1 2 3 4 5 16 0 0 0 6 15 0 0 0 7 14 0 0 0 8 13 12 11 10 9 number = 5 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9 number = 5 3 3 3 3 3 3 2 2 2 3 3 2 1 2 3 3 2 2 2 3 3 3 3 3 3

number = 5 1 3 6 10 15 2 5 9 14 19 4 8 13 18 22 7 12 17 21 24 11 16 20 23 25 number = 3 : 8 1 6 3 5 7 4 9 2 number = 5 : 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9 1 (3X3, 5x5) 2 3 4 5 3x3 1 a[0][1] 2 a[-1][2] -1 a[2][2] 3 a[1][3] 3 a[1][0] 4 a[0][1] a[2][0] 5 a[1][1] 6 a[0][2] 7 a[-1][3] -1, 3 a[2][0] a[0][2] a[1][2] 8 a[0][3] 3 a[0][0]

9 a[-1][1] a[2][1]

Chapter 8 - int i, n; printf("\nplease enter number:"); scanf("%d", &n); i=0; while(i<n) printf("\ni=%4d", i); i++; printf("\ni=%4d", i); while( ) ; int a[100]=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ; int i, n; printf("\nprint the contents of array a[]"); i=0; while(a[i]>0) printf("%4d", a[i]); i++; int a[100]=11, 12, 13, 14, 15, 6, 7, 8, 9, 10, ; int i, n; printf("\nprint the contents of array a[]");

i=0; while(a[i]>0) if(a[i]>10) printf("big "); else printf("small "); i++; int a[100]=11, 12, 13, 14, 15, 6, 7, 8, 9, 10, ; int i, n; printf("\nprint the contents of array a[]"); i=0; while(1) if(a[i]<=0) break; if(a[i]>10) printf("big "); else printf("small "); i++; int a[100]=11, 12, 13, 14, 15, 6, 7, 8, 9, 10, ; int b[100]=0,; int i, n; i=0; while(a[i]>0) b[i]=a[i]; i++; // a[] b[] printf("\nprint the contents of array b[]"); i=0; while(b[i]>0) printf("%4d", b[i]); i++;

1 1 1 1 2 1 1 2 1 1 2 2 1 1 1 1 1 2 2 1 3 1 2 2 2 1 1 3 1 1 1 2 3 1 2 3 1 1 1 1 2 2 1 3 1 1 1 2 1 3 1 1 3 1 1 2 2 1 1 3 1 1 3 2 1 1 1 3 1 1 2 3 1

Chapter 9 (1 ) 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 for(i=0;i<1000;i++) a[i]=i; 2 4 2 2 a[] 0 4, 6, 8, 10, 12, 14,,,, 2 3 3 6 3 3 6, 9, 12, 15, 18, 21,,,, 3 5 5 10 5 5 10, 15, 20, 25, 30, 35,,,, 5 7 7 14 7 7 14, 21, 28, 35, 42, 27,,,, 7 11 11

5 5 3 3 9 9 5 5 a[2]=5; 7 3 3 9 9 7 7 a[3]=7 9 3 3 9 9 9 9 11 3 3 9 9 11 11 3 11 5 5 25 25 11 11 a[4]=11 13 3 3 9 9 13 13 3 13 5 5 25 25 13 13 a[5]=13 15 3 3 9 9 15 15 3 17 3 3 9 9 17 17 3 17 5 5 25 25 17 17 a[6]=17 19 3

Chapter 10 FILE *fin; char finname[80]; int c; printf("\nplease enter File name:"); scanf("%s", finname); fin = fopen(finname, "r"); c = fgetc(fin); while(c!= EOF) printf("%c", c); c = fgetc(fin); fclose(fin); c = fgetc(fin); while(c!= EOF) printf("%c", c); c = fgetc(fin);

unsigned char a, b, c; a = 'A'; b = 'B'; c = 'C'; printf("\n%c %c %c ", a, b, c); A B C printf("\n%d %d %d ", a, b, c); 65 66 67 unsigned char a, b, c; a = 65; b = 66; c = 67; printf("\n%c %c %c ", a, b, c); FILE *fin, *fout; char finname[80]; char foutname[80]; int c;

printf("\nplease enter input file name:"); scanf("%s", finname); printf("\nplease enter output file name:"); scanf("%s", foutname); fin = fopen(finname, "rb"); if(fin==null) printf("\ncannot open file:%s", finname); exit(1); fout = fopen(foutname, "wb"); if(fout==null) printf("\ncannot open file:%s", foutname); exit(1); c = fgetc(fin); while(c!= EOF) fputc(c, fout); c = fgetc(fin); fclose(fin); fclose(fout); 23 69 6E 63 6C 75 64 65 3C 73 74 64 69 6F 2E 68 # i n c l u d e < s t d i o h 3E 0D 0A 69 6E 74 20 6D 61 69 6E 28 29 0D 0A 7B > i n t m a i n ( ) 0D 0A 20 20 20 20 69 6E 74 20 69 2C 20 6E 3B 0D i n t i, n ; 0A int i, n;

FILE *fin; char fname[80]; int c; printf("\nplease enter input file name:"); scanf("%s", fname); fin = fopen(fname, "rb"); if(fin==null) printf("\ncannot open file:%s", fname); exit(1); c = fgetc(fin); while(c!= EOF) printf("%02x ", c); c = fgetc(fin); fclose(fin);

Chapter 11 >hoidts<edulcni# )(niam tni ;n, j, i tni int i, j, n; # i i n n t c l m i u a n d i t e n < ( i s ), t d j i, o n h ; > $$$ $$$ $$$ int i, j, k;$$$int a[10]=0,; #include<stidoh>$$$>hoidts<edulcni# $$$)(niam tni $$$ int i, j, k;$$$;,0=]01[a tni 1 6 2 16 3 4 8 5 3 6 ( isprint ) 7 000000 23 69 6E 63 6C 75 64 65 3C 73 74 64 69 6F 2E 68 #include<stdioh

000010 3E 0D 0A 69 6E 74 20 6D 61 69 6E 28 29 0D 0A 7B > 000020 0D 0A 20 20 20 69 6E 74 20 69 2C 6A 2C 6E 2C 6B int i,j,n,k 000030 2C 6C 3B 0D 0A 20 20 20 69 6E 74 20 61 5B 33 30,l; int a[30 000040 5D 5B 33 30 5D 3D 7B 30 2C 7D 3B 0D 0A 0D 0A 20 ][30]=0,; 000050 20 20 70 72 69 6E 74 66 28 22 6E 75 6D 62 65 72 printf("number 000060 3D 22 29 3B 0D 0A 0D 0A 20 20 20 73 63 61 6E 66 ="); scanf 000070 28 22 25 64 22 2C 26 6E 29 3B 0D 0A 0D 0A 20 20 ("%d",&n); 000080 20 66 6F 72 28 69 3D 30 3B 69 3C 6E 3B 69 2B 2B for(i=0;i<n;i++ 000090 29 0D 0A 20 20 20 7B 0D 0A 20 20 20 20 20 20 66 ) f 0000A0 6F 72 28 6A 3D 30 3B 6A 3C 6E 3B 6A 2B 2B 29 0D or(j=0;j<n;j++) 0000B0 0A 20 20 20 20 20 20 7B 0D 0A 09 09 61 5B 69 5D a[i] 000230 20 20 20 7D 0D 0A 0D 0A 20 20 20 72 65 74 75 72 retur 000240 6E 20 30 3B 0D 0A 7D 0D 0A n 0; FILE *fin; char fname[80]; unsigned char line[100]; int c; printf("\nplease enter file name:"); scanf("%s", fname); fin = fopen(fname, "rb"); if(fin == NULL) printf("\ncannot open file: %s", fname); exit(1); c = fgetc(fin); while(c! = EOF) if(c!= 13) else 13 0D 0D 0A c = fgetc(fin); while fclose(fin); c = fgetc(fin); while(c!= EOF) c = fgetc(fin); if(c!= 13)

else 13 ( 0D) 0A FILE *fin1, fin2; char fname1[80], fname2[80]; unsigned char line[100]; int c, d; printf("\nplease enter file name:"); scanf("%s", fname1); printf("\nplease enter file name:"); scanf("%s", fname2); fin1 = fopen(fname1, "rb"); if(fin1 == NULL) printf("\ncannot open file: %s", fname1); exit(1); fin2 = fopen(fname1, "rb"); if(fin2 == NULL) printf("\ncannot open file: %s", fname2); exit(1); c = 0; d = 0; while((c!= EOF) && (d!= EOF)) c = fgetc(fin1); while((c! = EOF)&&(c!= 13)) c = fgetc(fin1); // while loop EOF 13 if(c!= EOF) 13 0D 0D 0A else // d = fgetc(fin2); while((2! = EOF)&&(2!= 13)) d = fgetc(fin2); // while loop EOF 13 if(c!= EOF) 13 0D 0D 0A else //

file1 file2 fclose(fin1); fclose(fin2);

Chapter 12 // oneline int oneline(int n) int i; printf("%4d", i+1); int i, n; printf("\nplease enter number:"); scanf("%d", &n); oneline(i+1); // oneline printf("\n"); int i, j, n; printf("\nplease enter number:"); scanf("%d", &n); for(j=0;j<i+1;j++) printf("%4d", j+1); printf("\n"); int factorial(int n)

int i, fact; fact = 1; for(i=2;i<=n;i++) fact = i*fact; return fact; int square(int n) return n*n; int n; printf("\nplease enter number:"); scanf("%d", &n); printf("\nnumber=%4d factorial = %4d square = %4d ", n, factorial(n), square(n));

Chapter 13 # #### # # # # ## # # # 1 2 3 4 5 2 3 4 5 1 3 4 5 1 2

Chapter 14 -C/C++,

Chapter 15 -?

Chapter 16