Đề thi về C++

5 732 6
Đề thi về C++

Đang tải... (xem toàn văn)

Thông tin tài liệu

Đề thi về C++

C++Question #1Q What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6b) 38c) An unlimited numberAnswer: AQuestion #2Q Which of the following is evaluated first: a) &&b) ||c) !Answer: CQuestion #3Q What does 7/9*9 equal (in C and C++)? a) 1b) 0.08642c) 0Answer: CQuestion #4Q Which is not valid in C? a) class aClass{public:int x;};b) /* A comment */c) char x=12;Answer: AQuestion #5Q Which of the following is not a valid declaration for main()? a) int main()b) int main(int argc, char *argv[])c) They both workAnswer: CQuestion #6Q Evaluate as true or false: !(1 &&0 || !1) a) Trueb) Falsec) Invalid statementAnswer: AQuestion #7Q Which command properly allocates memory? a) char *a=new char[20];b) char a=new char[20];c) char a=new char(20.0);Answer: AQuestion #8Q What operator is used to access a struct through a pointer? a) ->b) >>c) *Answer: CQuestion #9Q Which is not an ANSII C++ function? a) sin()b) kbhit()c) tmpnam()Answer: BQuestion #10Q True or false, if you keep incrementing a variable, it will become negative? a) Trueb) Falsec) It depends .Answer: C Question #11Q What character terminates all character array strings a) \0b) .c) \ENDAnswer: AQuestion #12Q If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first? a) 5b) 1c) 3Answer: AQuestion #13Q What does strcat(an_array, "This"); do? a) Copies "This" into an_arrayb) Adds "This" to the end of an_arrayc) Compares an_array and "This"Answer: BQuestion #14Q Evaluate:int fn(int v){if(v==1 || v==0)return 1;if(v%2==0)return fn(v/2)+2;elsereturn fn(v-1)+3;}for fn(7); a) 10b) 11c) 1 Answer: BQuestion #15Q Evalute the following: 22%5a) 2b) 4c) 0Answer: AQuestion #16Q Which of the following data structures is on average the fastest for retrieving data?a) Binary Treeb) Hash Tablec) StackAnswer: BQuestion #17Q What is the output:int v(){ int m=0;return m++;}int main(){cout<<v();}a) 1b) 0c) Program is illegalAnswer: BQuestion #18Q What does cout<<(0==0) print out? a) 0b) 1c) Compiler error: Lvalue requiredAnswer: BQuestion #19Q What is the maximum value of a unsigned char? a) 255b) 256c) 128Answer: AQuestion #20Q Evaluate !(1&&1||1&&0) a) Errorb) Truec) FalseAnswer: C . strcat(an_array, "This"); do? a) Copies "This" into an_arrayb) Adds "This" to the end of an_arrayc) Compares an_array and "This"Answer:. &&b) ||c) !Answer: CQuestion #3Q What does 7/9*9 equal (in C and C++) ? a) 1b) 0.08642c) 0Answer: CQuestion #4Q Which is not valid in C? a)

Ngày đăng: 02/11/2012, 13:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan