chtp5_02-TIF-Beta - 2.1Introduction...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
2.1  Introduction 2.2  A Simple Program: Printing a Line of Text 2.1 Lines beginning with the _______________ let the computer know that the rest of the line is a comment. (a) /* (b) ** (c) REM (d) << ANS: (a) 2.2 Which of the following must every C++ program have? (a) main (b) #include (c) // (d) <stdio.h> ANS: (a) 2.3 Every statement in C must end with a (a) period ( . ) (b) semicolon ( ; ) (c) colon ( : ) (d) backslash ( / ) ANS: (b) 2.4 Which of the following is not a valid escape sequence? (a) \n (b) \\ (c) \~ (d) \” ANS: (c) 2.5. Which statement about comments is false? a) Comments begin and end with /* and */ , respectively. b) Programmers insert comments to document programs and improve program readability. c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance. ANS: (d)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2.6. Lines beginning with a # are processed a) at execution time b) at compile time c) at preprocessor time d) at postprocessor time ANS: (c) 2.7. Which of the following statements about the inclusion of <stdio.h> is false? a) It is required. b) This header file contains information and declarations used by the compiler when compiling standard input/output library functions such as printf . c) This header file contains information that helps the compiler determine if calls to library functions have been made correctly. d) This header helps locate bugs in your program at compile time, rather than at execution time (when errors are usually more costly to correct. ANS: (a) 2.8. In the line  int main() the parentheses indicate that main is a program building block called a a) module b) statement c) method d) function ANS: (d) 2.9. The pair of braces that delineate the body of main and the portion of the program between these braces is called a __________. a) function b) block c) statement d) header ANS: (b) 2.10. Which of the following is not a synonym for a C string? a) message b) character string c) character d) literal ANS: (c) 2.11. The following line is most properly an example of a __________.
Background image of page 2
printf( “Welcome to C!” ) a) function b) block c) statement d) header ANS: (c) 2.12. In a printf , a backslash is printed by enclosing in quotes a) \ b) \\ c) /\ d) // ANS: (b) 2.13. A linked program is often called a(n) __________. a) chain
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2011 for the course C PROGRAMM ES 112 taught by Professor Serdar during the Spring '11 term at Yeditepe Üniversitesi.

Page1 / 9

chtp5_02-TIF-Beta - 2.1Introduction...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online