Question #1
ã What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)?
a) 6
b) 38
c) An unlimited number
Answer: A
Question #2
ã Which of the following is evaluated first:
a) &&
b) ||
c) !
Answer: C
Question #3
ã What does 7/9*9 equal (in C and C++)?
a) 1
b) 0.08642
c) 0
Answer: C
6 trang |
Chia sẻ: aloso | Lượt xem: 1767 | Lượt tải: 0
Bạn đang xem nội dung tài liệu Đề thi về C++, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
C++
Question #1
· What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)?
a) 6b) 38c) An unlimited number
Answer: A
Question #2
· Which of the following is evaluated first:
a) &&b) ||c) !
Answer: C
Question #3
· What does 7/9*9 equal (in C and C++)?
a) 1b) 0.08642c) 0
Answer: C
Question #4
· Which is not valid in C?
a) class aClass{public:int x;};b) /* A comment */c) char x=12;
Answer: A
Question #5
· Which of the following is not a valid declaration for main()?
a) int main()b) int main(int argc, char *argv[])c) They both work
Answer: C
Question #6
· Evaluate as true or false: !(1 &&0 || !1)
a) Trueb) Falsec) Invalid statement
Answer: AQuestion #7
· 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: A
Question #8
· What operator is used to access a struct through a pointer?
a) ->b) >>c) *
Answer: C
Question #9
· Which is not an ANSII C++ function?
a) sin()b) kbhit()c) tmpnam()
Answer: B
Question #10
· True or false, if you keep incrementing a variable, it will become negative?
a) Trueb) Falsec) It depends...
Answer: C
Question #11
· What character terminates all character array strings
a) \0b) .c) \END
Answer: A
Question #12
· If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first?
a) 5b) 1c) 3
Answer: A
Question #13
· 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: B
Question #14
· 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: B
Question #15
· Evalute the following: 22%5a) 2b) 4c) 0
Answer: AQuestion #16
· Which of the following data structures is on average the fastest for retrieving data?a) Binary Treeb) Hash Tablec) Stack
Answer: B
Question #17
· What is the output:int v(){ int m=0;return m++;}int main(){cout<<v();}
a) 1b) 0c) Program is illegal
Answer: B
Question #18
· What does cout<<(0==0) print out?
a) 0b) 1c) Compiler error: Lvalue required
Answer: B
Question #19
· What is the maximum value of a unsigned char?
a) 255b) 256c) 128
Answer: A
Question #20
· Evaluate !(1&&1||1&&0)
a) Errorb) Truec) False
Answer: C
Các file đính kèm theo tài liệu này:
Đề thi về C++.doc