2.7 Identify and correct theerror in each of the following statements. [Note : there may be more than one error per statement.] a) scanf("%d", &value); b) printf("The sum of %d and %d is %d\n", x, y, x+y); c) int sum = a+b+c; d) if (number >= largest) largest = number; e) (backslash is /) //program to determine the largest of three integers. f) (cannot use float as value name. because it is keyw..
2.1 Fill the blanks in each of the following a) every C program begins execution at the function -----. 더보기 main b) Every functions's body begins with ----- and ends with -----. 더보기 { , } c) Every statement ends with an ----- 더보기 semicolon (;) d) The ----- standard library functions displays information on the screen. 더보기 printf e) The escape sequence \n represents the ----- character, which cau..
① 일반적인 프로그램의 형태 입력단계 -> 처리단계 -> 출력단계 ②좋은 프로그래밍의 요소 좋은 프로그래밍은 크게 3가지를 요한다. 들여쓰기, 주석, 좋은 변수명이다. 이때 변수란 프로그램이 사용하는 데이터를 일시적으로 저장할 목적으로 사용하는 메모리 공간이다. 즉, 데이터를 저장하기 위한 메모리 공간이라고 생각하면 된다. 변수는 데이터 타입에 따라서 여러가지가 존재한다. 변수와 상수를 혼동해선 안된다. 변수는 실행 도중에 값을 변경할 수 있지만 상수는 한 번 값이 정해지면 변경이 불가하다. 변수와 키워드 (== 예약어)는 겹치면 실행이 불가하다. ③ 출력함수 printf() : 모니터에 출력을 하기 위한 표준 출력 라이브러리 함수. printf()를 사용하기 위해서는 #include 가 꼭 있어야한다...