Enter your search terms
Submit search form
Web
examineonline.googlepages.com
Online Exam
>>
Programming
>>
C/C++
>>
Test 1
Menu
Programming
COMPTIA
GMAT
English
IQ
DataBase
OS
MCSE
CISCO
Finance
Management
Health
Soft Skills
Web Building
Multimedia
Test 1
1 . What number of digits that can be accurately stored in a float (based on the IEEE Standard 754)?
A.
6
B.
38
C.
An unlimited number
2 . Which of the following is evaluated first:
A.
&&
B.
||
C.
!
3 . What does 7/9*9 equal (in C and C++)?
A.
1
B.
0.08642
C.
0
4 . Which is not valid in C?
A.
class aClass{public:int x;};
B.
/* A comment */
C.
char x=12;
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
6 . Evaluate the following as true or false: !(1 &&0 || !1)
A.
True
B.
False
C.
Invalid statement
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);
8 . What operator is used to access a struct through a pointer?
A.
->
B.
>>
C.
*
9 . Which is not an ANSI C++ function?
A.
sin()
B.
kbhit()
C.
tmpnam()
10 . True or false: If you continuously increment a variable, it will become negative?
A.
True
B.
False
C.
It depends on the variable type
11 . What character terminates all strings composed of character arrays?
A.
\0
B.
.
C.
\END
12 . If you push 1, 3, and 5 - in that order - onto a stack, which number is popped out first?
A.
5
B.
1
C.
3
13 . What does the code strcat(an_array, "This"); do?
A.
Copies "This" into an_array
B.
Adds "This" to the end of an_array
C.
Compares an_array and "This"
14 . Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7);
A.
10
B.
11
C.
1
15 . Evaulate the following: 22%5
A.
2
B.
4
C.
0
16 . Which of the following data structures is on average the fastest for retrieving data:
A.
Binary Tree
B.
Hash Table
C.
Stack
17 . What is the output of the following code: int v() { int m=0; return m++; } int main() { cout<<v(); }
A.
1
B.
0
C.
Code cannot compile
18 . Which of the following functions initalizes the variables contained in a class:
A.
Constructor
B.
Destructor
C.
Constitutor
19 . Is C++ case sensitive?
A.
No
B.
Case sensitivity is compiler-determined
C.
Yes
20 . Which datatype can store decimal numbers?
A.
unsigned int
B.
char
C.
float
21 . What does the code "cout<<(0==0);" print?
A.
0
B.
1
C.
Compiler error: Lvalue required
22 . According to the ANSI C++ standard, what does the getch() do?
A.
Reads in a character Checks the keyboard buffer
B.
Nothing
C.
(getch() is not an ANSI C++ function)
23 . If the program completes executing successfully, what value should the function main() return?
A.
0
B.
1
C.
void
24 . C is to C++ as 1 is to
A.
2
B.
What the heck?
C.
10
25 . Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4
A.
Quick Sort
B.
Bubble Sort
C.
Merge Sort
Test Name :
Test 1
Category :
C/C++
Number of Question :
25
Pass Score :
80
Test Result
Your Score :
Passing Score :
80
Result :
Copyright by
VanTuMinh
© 2007