Pregunta 1
Pregunta
1. Specify the types of operator
Respuesta
-
Logical, Bitwise, Arithmetic, Relational
-
Mathematical, Bitwise, Arithmetic, Relational
-
Assignment, Bitwise, Arithmetic, Relational
-
Logical, Bitwise, Assignment, Relational
Pregunta 2
Pregunta
2. Logical operators always evaluated from
Respuesta
-
Left to right
-
No difference
-
Not sure
-
Right to left
Pregunta 3
Pregunta
3. When an equation uses more than one type of operator then the order of precedence has to be established with the different types of operators:
Respuesta
-
Arithmetic, comparison, logical
-
Comparison, logical, arithmetic
-
Logical, arithmetic, comparison
-
Arithmetic, logical, comparison
Pregunta 4
Pregunta
4. Precedence for Logical Operators
Respuesta
-
NOT, AND, OR
-
OR, AND, NOT
-
OR, NOT, AND
-
AND, OR, NOT
Pregunta 5
Pregunta
5. What is an array?
Respuesta
-
An array is a series of elements of the different type placed in contiguous memory locations that can be individually referenced by adding an index to a unique.
-
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by multiplying an index to a unique identifier
-
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier
-
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a same identifier.
Pregunta 6
Pregunta
6. When an array is partially initialized, the rest of its elements will automatically be set to zero
Respuesta
-
False
-
True
-
Nothing
-
All of them
Pregunta 7
Pregunta
7. The whole array can be passed to a function. However, it can't be changed by the code in that function
Respuesta
-
False
-
All of them
-
Nothing
-
True
Pregunta 8
Pregunta
8. What are the three steps in using a function?
Respuesta
-
Definition, prototype, invocation
-
Prototype, argument, signature
-
Definition, invocation, argument
Pregunta 9
Pregunta
9. write mpg() function prototype, that takes two type double arguments and returns a double
Respuesta
-
Double mpg(double a, double b)
-
Void mpg(){}
-
Float mpg(int a){ float b = 1; return b;}
-
Double mpg(int a, double b)
Pregunta 10
Pregunta
10. What is data structure?
Respuesta
-
is a group of data elements grouped together under one name
-
is a group of data elements grouped together under two names.
-
is a set of some elements grouped together under value
-
is a group of data elements together with some name.
Pregunta 11
Pregunta
11. The data elements in structure are also known as what?
Respuesta
-
Members
-
Data
-
Objects
-
None of the above
Pregunta 12
Pregunta
12. What will be used when terminating a structure?
Respuesta
-
Semicolon
-
Colon
-
Brackets
-
Dot
Pregunta 13
Pregunta
13. Which stream class is used to both read and write on files?
Respuesta
-
Fstream
-
Iostream
-
Ofstream
-
Ifstream
Pregunta 14
Pregunta
14. Which stream class is only used to read files
Respuesta
-
Ifstream
-
Ofstream
-
Iostream
-
Fstream
Pregunta 15
Pregunta
15. What is the difference between array and structure?
Respuesta
-
Structure can include members of different data types
-
No difference
-
Only on their declaration
-
Arrays can include only integers
Pregunta 16
Pregunta
16. What is the output from the following program code?
Respuesta
-
10 10 10 10 10
-
11 11 11 11 11
-
10
-
0 1 2 3 4
-
Error
Pregunta 17
Pregunta
17. The OR (||) operator:
Respuesta
-
Stops evaluation upon finding one condition to be true
-
Has higher precedence that AND (&&) operator
-
True if all conditions are true
-
Associates from right to left
Pregunta 18
Pregunta
18. Which of the following for headers is not valid for C++ code?
Respuesta
-
for (integer i =0; j<10; i++);
-
for (int i = 0; i<9; i++)
-
for (int i = 0; i<8; i++)
-
for (int i = 0; i<7; i++)
-
all
Pregunta 19
Pregunta
19. There might be functions with the same name, but different arguments. The function called is the one whose arguments match the invocation. What is this mean?
Respuesta
-
Function overloading
-
Function overprocessing
-
Argument type error
-
Argument dispatch error
Pregunta 20
Pregunta
20. Which of the following cannot be used to create a random numbers?
Respuesta
-
structures
-
float
-
int
-
none of the mentioned
Pregunta 21
Pregunta
21. Please evaluate !(1 && !(0 || 1)).
Respuesta
-
True
-
False
-
Unevaluatable
-
Not sure
Pregunta 22
Pregunta
22. What is the final value of x when the code int x; for(x=0; x<50; x++) {} is run?
Pregunta 23
Pregunta
23. How many times is a do while loop guaranteed to loop?
Pregunta 24
Pregunta
24. What is the output of the following code?
Respuesta
-
value
-
77.5
-
Float
-
Variable
Pregunta 25
Pregunta
25. Which of the following is a valid function call (assuming the function exists)?
Respuesta
-
funct;
-
funct x, y;
-
funct();
-
struct funct();
Pregunta 26
Pregunta
26. Which of the following is a complete function?
Respuesta
-
int funct();
-
int funct(int x) {return x=x+1;}
-
void funct[int] {cout&tl;<"Hello"}
-
void funct{x} {cout<<"Hello"}
Pregunta 27
Pregunta
27. Which of the following is required to avoid falling through from one case to the next?
Respuesta
-
End;
-
Break;
-
Stop;
-
A semicolon;
Pregunta 28
Pregunta
28. Which of the following is the proper declaration of a pointer?
Respuesta
-
int x;
-
int &x;
-
ptr x;
-
int *x;
Pregunta 29
Pregunta
29. Which of the following gives the memory address of integer variable a?
Pregunta 30
Pregunta
30. Which of the following gives the memory address of a pointer a?
Pregunta 31
Pregunta
31. Which of the following gives the value stored at the address pointed to by the pointer a?
Pregunta 32
Pregunta
32. Which of the following gives the value stored at the address pointed to by the pointer ptr?
Respuesta
-
ptr;
-
val(ptr);
-
*ptr;
-
&ptr;
Pregunta 33
Pregunta
33. Which of the following accesses a variable in structure b?
Respuesta
-
b->var;
-
b.var;
-
b-var;
-
b>var;
Pregunta 34
Pregunta
34. Which of the following accesses a variable in structure mystruct?
Respuesta
-
mystruct ->var;
-
mystruct.var;
-
mystruct -var;
-
mystruct >var;
Pregunta 35
Pregunta
35. Which of the following correctly accesses the seventh element stored in diana, an array with 100 elements?
Respuesta
-
diana[6]
-
diana[7]
-
diana(7)
-
diana;
Pregunta 36
Pregunta
36. What is the correct way to write the condition y < x < z?
Respuesta
-
((y < x) && (x < z))
-
((y < x) || (x < z))
-
((y < x) & (x < z))
-
((y < x) AN (x < z))
Pregunta 37
Pregunta
37. The value 132.54 can represented using which data type?
Pregunta 38
Pregunta
38. In an assignment statement “ a=b; ” which of the following statement is true?
Respuesta
-
The variable a and the variable b are equal.
-
The value of b is assigned to variable a but the later changes on variable b will not effect the value of variable
-
The value of variable a is assigned to variable b and the value of variable b is assigned to variable a.
Pregunta 39
Pregunta
39. The difference between while structure and do structure for looping is
Respuesta
-
In while statement the condition is tested at the end of first iteration
-
In do structure the condition is tested at the beginning of first iteration
-
The do structure decides whether to start the loop code or not whereas while statement decides whether to repeat the code or not
-
In while structure condition is tested before executing statements inside loop whereas in do structure condition is tested before repeating the statements inside loop
Pregunta 40
Pregunta
40. A function that calls itself for its processing is known as
Respuesta
-
Inline Function
-
Nested Function
-
Overloaded Function
-
Recursive Function
Pregunta 41
Pregunta
41. The keyword endl
Respuesta
-
Ends the execution of program where it is written
-
Ends the output in cout statement
-
Ends the line in program. There can be no statements after endl
-
Ends current line and starts a new line in cout statement
Pregunta 42
Pregunta
42. Strings are character arrays. The last index of it contains the nullterminated character
Pregunta 43
Pregunta
43. Variables inside parenthesis of functions declarations have _____ level access
Respuesta
-
Local
-
Global
-
Module
-
Universal
Pregunta 44
Pregunta
44. Array indexing always starts with the number
Pregunta 45
Pregunta
45. Which of the following accesses a variable in structure st1?
Respuesta
-
st1->var;
-
st1.var;
-
st1-var;
-
st1>var;
Pregunta 46
Pregunta
46. Which looping process is best used when the number of iterations is known?
Respuesta
-
For
-
While
-
Do-while
-
Nothing
Pregunta 47
Pregunta
47. If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?
Respuesta
-
parentheses ( )
-
braces { }
-
brackets [ ]
-
arrows < >
Pregunta 48
Pregunta
48. A memory address is…
Respuesta
-
where a variable is stored.
-
where a variable is defined.
-
where a variable is declares.
-
where a variable is print out.
Pregunta 49
Pregunta
49. The set of instructions that a computer will follow is known as..
Respuesta
-
program
-
variable
-
computer
-
brackets
Pregunta 50
Pregunta
50. cin >> number; is
Respuesta
-
an output statement
-
a colon
-
a variable
-
an input statement
Pregunta 51
Pregunta
51. cout << "How many items would you want?\n"; is
Respuesta
-
an output statement
-
a colon
-
a variable
-
an input statement
Pregunta 52
Pregunta
52. int number; is
Respuesta
-
an output statement
-
a variable declaration
-
a variable
-
an input statement
Pregunta 53
Pregunta
53. If x is 0, what is the value of (!x == 0)?
Pregunta 54
Pregunta
54. How to create array with n integers?
Respuesta
-
int n; cin >> n; int a = new# int[n];
-
int n; cin >> n; int& a; a = new int[n];
-
int n; cin >> n; int* a; a = new int[n];
-
int n; cin >> n; int a; a = new% int[n];
Pregunta 55
Pregunta
55. Which class should be included to work with files?
Respuesta
-
iostream
-
string
-
cmath
-
fstream
Pregunta 56
Pregunta
56. Which of the following is the output from the following C++ code?
Respuesta
-
15 14 13 12 11 10
-
15 14 13 12 11 10 9
-
9
-
15
Pregunta 57
Pregunta
57. If originally x=0, y=1, and z=3, what is the value of x, y, and z after executing the following code ?
Respuesta
-
x=0 y=3 z=3
-
x=0 y=1 z=3
-
x=3 y=3 z=3
-
x=3 y=1 z=0
Pregunta 58
Pregunta
58. What is the value of x after the following statements?
Pregunta 59
Pregunta
59. What is the value of x after the following statements?
Pregunta 60
Pregunta
60. Which of the following is the output from the following C++?
Pregunta 61
Pregunta
61. Given the following code fragment, what is the final value of y?
Pregunta 62
Pregunta
62. Which of the following is the output from the following C++ code
Pregunta 63
Pregunta
64. Which of the following is the final value of y from the following C++ code
Pregunta 64
Pregunta
63. Which of the following is the output from the following C++ code?
Pregunta 65
Pregunta
65. Which of the following is the final value of ‘i’ from the following C++ code ?
Respuesta
-
5
-
4
-
0 1 2 3 4
-
0 1 2 3 4 5
Pregunta 66
Pregunta
66. What is the value of x after the following code executes?
Pregunta 67
Pregunta
67. Given the following code, what is the final value of i?
Pregunta 68
Pregunta
68. What is the value of x after the following code executes?
Pregunta 69
Pregunta
69. What is the output of the following code segment?
Pregunta 70
Pregunta
70. What does the following code print to the screen?
Pregunta 71
Pregunta
71. What is the value of x after the following statements?
Pregunta 72
Pregunta
72. What is the value of x after the following statements?
Pregunta 73
Pregunta
73. What is the value of x after the following code executes?
Pregunta 74
Pregunta
74. Given the following code, what is the final value of i?
Pregunta 75
Pregunta
75. Given the following code, what is the final value of i?
Pregunta 76
Pregunta
76. Which of the following is the valid array declaration
Respuesta
-
int num(5)
-
int mycat[5]
-
Array. double[5] marks
-
Myarray.counter int[5]
Pregunta 77
Pregunta
77. What is the output of the following code?
Pregunta 78
Pregunta
78. What is the value of x after the following statements ?
Pregunta 79
Pregunta
79. What is the final output of the following code fragment ?
Pregunta 80
Pregunta
80. Solve the following piece of code and choose the best answer?
Pregunta 81
Pregunta
81. If the type specifies of parameters of a function is followed by an ampersand &, that function call is…
Respuesta
-
Pass by value
-
Pass by reference
-
All of answers
-
None of answers
Pregunta 82
Pregunta
82. Which of the following gives the memory address of a pointer pt1?
Respuesta
-
*pt1;
-
pt1;
-
&pt1;
-
address(ptr1);
Pregunta 83
Pregunta
83. What is the value of x after the following statement?
Pregunta 84
Pregunta
84. What is the final value of x after the following fragment of codeexecutes ?
Pregunta 85
Pregunta
85. What is the value of x after the following statement?
Pregunta 86
Pregunta
86. What is the value of x after the following statements ?
Pregunta 87
Pregunta
87. What is the value of x after the following statements?
Pregunta 88
Pregunta
88. Given the following code fragment, what is the output
Respuesta
-
5
-
That is all. Goodbye
-
X is bigger than 5
-
X
Pregunta 89
Pregunta
89. How many times is "Hi" printed to the screen ?
Pregunta 90
Pregunta
90. How to read file and take first string?
Respuesta
-
File should be created before running the code : “input.txt” .
-
No need to create file before running the code, code will create it by itself.
-
File should be created before running the code: “input.txt” .
-
No need to create file before running the code, code will create it by itself .
Pregunta 91
Pregunta
91. How to write to file?
Respuesta
-
File should be created before running the code: “output.txt” .
-
No need to create file before running the code, code will create it by itself .
-
File should be created before running the code: “output.txt” .
-
No need to create file before running the code, code will create it by itself
Pregunta 92
Pregunta
92. There is given array with n elements, created as pointer.
How to remove it correctly?
Respuesta
-
delete a;
-
delete[] a;
-
remove[] a;
-
remove a;
Pregunta 93
Pregunta
93. How to write correct recursive function for making sum of n numbers?
Pregunta 94
Pregunta
94. How to make several items in structure? Just think that you have “HOME”, and n items in it
Pregunta 95
Pregunta
95. Find mistake of next cod ?
Respuesta
-
No mistakes, it will just read from file and print first string in command line
-
Mistake in opening file, should be: file.open(“input.txt”);
-
It should write in other file; it can’t write directly to command line.
-
It should read from read from file, when we want to write in command line.
Pregunta 96
Pregunta
96. What will print in command line next code ?
Respuesta
-
Read first string from file “input.txt”, and print it in command line.
-
It will give an error, because, file should read in this way: file.open(“input.txt”);
-
It won’t print anything.
-
Read all lines and print it in new file.
Pregunta 97
Pregunta
97. Which one will be correct function for ?
Pregunta 98
Pregunta
98. There are given array “numbers” with 10 numbers. How to make sum of all numbers, which are located in odd indexes?
Pregunta 99
Pregunta
99. There is given string named “str”. How to print in command line length of str?
Respuesta
-
cout << str.count();
-
cout << str.length;
-
cout << str.lenth();
-
cout >> str.lenth();
Pregunta 100
Pregunta
100. How to implement array of chars with 10 elements?
Respuesta
-
char* chs; chs = new char(10);
-
char chs; chs = char[10];
-
char chs[10];
-
char chs[] = new char[10];
Pregunta 101
Pregunta
101. How to implement array of integer numbers with n elements, and how to delete them correctly?
Respuesta
-
int n; cin >> n; int* a; a = new% int[n]; delete[] a;
-
int n; cin >> n; int& a; a = new int[n]; delete[] a;
-
int n; cin >> n; int* a; a = new@ int[n]; delete[n] a;
-
int n; cin >> n; int* a; a = new& int[n]; for(int
i=0; i<n; i++) delete a;
Pregunta 102
Pregunta
102. How to get whole string in one line (in command line)?
Respuesta
-
string s; getline(cin, s);
-
string s; getline(cout, s);
-
string s; cin >> s;
-
string s; cout << s;
Pregunta 103
Pregunta
103. How to get whole string in one line (in file)?
Respuesta
-
ifstream file; string s; getline(file, s);
-
ifstream file; string s; getline(cin, s);
-
ifstream file; string s; getline(cout, s);
-
ifstream file; string s; file >> s;
Pregunta 104
Pregunta
104. Why do we need library?
Pregunta 105
Pregunta
105. Why do we need library <cmath>?
Respuesta
-
To work with strings.
-
To work with mathematical functions.
-
To work with command line.
-
To work with our own libraries.
Pregunta 106
Pregunta
106. Where is the mistake of the code ?
Pregunta 107
Pregunta
107. What will be printed in the part of the cod?
Respuesta
-
1 4 7 10
-
0 3 6 9
-
3 6 9
-
9 6 3 0
Pregunta 108
Pregunta
108. What will be printed in the part of the code?
Respuesta
-
0 8 16 24 32
-
2 10 18 26 34
-
6 12 20 28 36
-
4 10 18 26 34
Pregunta 109
Pregunta
109. Which of the following is the proper keyword to allocate memory?
Pregunta 110
Pregunta
110. Which of the following is the proper keyword to deallocate memory?
Pregunta 111
Pregunta
111. Assume if A = 10; and B = 15; with using bitwise OR operator Find A||B
Pregunta 112
Pregunta
112. The notation of logical NOT operator in a C++ program is
Pregunta 113
Pregunta
113. Which of the following denote C++ looping statement?
Respuesta
-
All of them
-
for
-
while
-
do-while
Pregunta 114
Pregunta
Cin in C++ program uses the operator
Pregunta 115
Pregunta
What is the minimum number of times a do loop would definitely get executed?
Respuesta
-
1
-
inf
-
0
-
None of the above
Pregunta 116
Pregunta
The function named as exforsys declared as int exforsys(float x, double y) has return type as
Pregunta 117
Pregunta
Which of the following is mandatory for all C++ program?
Respuesta
-
main()
-
void()
-
system()
-
None of the above
Pregunta 118
Pregunta
Which of the following denote newline character in C++ program?
Pregunta 119
Pregunta
Which of the following is used to group a set of objects and functions under a name?
Respuesta
-
namespace
-
name
-
namearea
-
areaname
Pregunta 120
Pregunta
What is the notation used to place block of statements in a looping structure in C++?
Pregunta 121
Pregunta
What is the notation used show the size of array?
Pregunta 122
Pregunta
How many values can be returned by a C++ function?
Respuesta
-
1
-
Inf
-
0
-
None of the above
Pregunta 123
Pregunta
123. Which of the following is returned by the system if a C++ program completes successfully?
Pregunta 124
Pregunta
124. The variables that can be used only within the function in which it is declared is called as
Respuesta
-
local
-
global
-
both of them
-
none of them
Pregunta 125
Pregunta
125. Comments in C++ program is written by using
Pregunta 126
Pregunta
126. The array exforsys[10] can be declared using pointers as
Respuesta
-
* exforsys[ ]
-
exforsys[ ]
-
$exforsys[ ]
-
&exforsys[ ]
Pregunta 127
Pregunta
127. Default size of int in c++ (in bytes)
Pregunta 128
Pregunta
128. Default size of double in c++ (in bytes)
Pregunta 129
Pregunta
129. Default value of boolean
Pregunta 130
Pregunta
130. If a function in C++ does not return a value then its return type is denoted as
Pregunta 131
Pregunta
131. A user defined header file is included by following statement in general.
Respuesta
-
#include "file.h"
-
#include <file.h>
-
#include file.h
-
#include <file>
Pregunta 132
Pregunta
132. An inline function can execute faster than a normal function.
Pregunta 133
Pregunta
133. What value must a destructor return?
Pregunta 134
Pregunta
134. What character ends all strings?
Pregunta 135
Pregunta
135. Which of the following reads in a string named x with one hundred characters?
Respuesta
-
cin.getline(x, 100, '\n');
-
cin.getline(100, x, '\n');
-
readline(x, 100, '\n');
-
read(x);
Pregunta 136
Pregunta
136. Which of the following functions compares two strings?
Respuesta
-
strcmp();
-
cmp();
-
stringcompare();
-
compare();
Pregunta 137
Pregunta
137. Which of the following adds one string to the end of another?
Respuesta
-
strcat();
-
append();
-
stradd();
-
stringadd();
Pregunta 138
Pregunta
138. Which of the following correctly declares an array?
Respuesta
-
int anarray[10];
-
int anarray;
-
anarray{10};
-
array anarray[10];
Pregunta 139
Pregunta
139. What is the index number of the last element of an array with 29 elements?
Pregunta 140
Pregunta
140. Which of the following is a two-dimensional array?
Respuesta
-
int anarray[20][20];
-
array anarray[20][20];
-
int array[20, 20];
-
char array[20];
Pregunta 141
Pregunta
141. Which of the following correctly accesses the seventh element stored in foo, an array with 100
elements?
Pregunta 142
Pregunta
142. Which of the following accesses a variable in structure b?
Respuesta
-
b.var
-
b->var
-
b-var
-
b>var
Pregunta 143
Pregunta
143. Which of the following accesses a variable in structure *b?
Respuesta
-
b->var
-
b.var
-
b-var
-
b>var
Pregunta 144
Pregunta
144. Which of the following is a properly defined struct?
Pregunta 145
Pregunta
145. Which properly declares a variable of struct foo?
Respuesta
-
foo var
-
struct foo
-
foo
-
int foo
Pregunta 146
Pregunta
146. Which of the following is the proper declaration of a pointer?
Respuesta
-
int *x;
-
int &x;
-
ptr x;
-
int x;
Pregunta 147
Pregunta
147. Which of the following gives the memory address of integer variable a?
Respuesta
-
&a;
-
*a;
-
address(a);
-
a;
Pregunta 148
Pregunta
148. Which of the following gives the value stored at the address pointed to by the pointer a?
Pregunta 149
Pregunta
149. Which of the following is the proper keyword to allocate memory?
Pregunta 150
Pregunta
150. Which of the following is the proper keyword to deallocate memory?
Pregunta 151
Pregunta
151. What is the notation used to place block of statements in a looping structure in C++?
Pregunta 152
Pregunta
152. What is the notation used show the size of array?
Pregunta 153
Pregunta
153. How many values can be returned by a C++ function?
Respuesta
-
1
-
Inf
-
0
-
None of the above
Pregunta 154
Pregunta
154. Which of the following is returned by the system if a C++ program completes successfully?
Pregunta 155
Pregunta
155. The variables that can be used only within the function in which it is declared is called as
Respuesta
-
local
-
global
-
both of them
-
none of them
Pregunta 156
Pregunta
156. Comments in C++ program is written by using
Pregunta 157
Pregunta
157. The array exforsys[10] can be declared using pointers as
Respuesta
-
* exforsys[ ]
-
exforsys[ ]
-
$exforsys[ ]
-
&exforsys[ ]
Pregunta 158
Pregunta
158. Default size of int in c++ (in bytes)
Pregunta 159
Pregunta
159. Default size of double in c++ (in bytes)
Pregunta 160
Pregunta
160. Default value of boolean
Pregunta 161
Pregunta
161. If a function in C++ does not return a value then its return type is denoted as
Pregunta 162
Pregunta
162. A user defined header file is included by following statement in general.
Respuesta
-
#include “file.h”
-
#include <file.h>
-
#include file.h
-
#include <file>
Pregunta 163
Pregunta
163. An inline function can execute faster than a normal function.
Pregunta 164
Pregunta
164. What value must a destructor return?
Pregunta 165
Pregunta
165. What character ends all strings?
Pregunta 166
Pregunta
166. Which of the following reads in a string named x with one hundred characters?
Respuesta
-
cin.getline(x, 100, '\n');
-
cin.getline(100, x, '\n');
-
readline(x, 100, '\n');
-
read(x);
Pregunta 167
Pregunta
167. Which of the following functions compares two strings?
Respuesta
-
strcmp();
-
cmp();
-
stringcompare();
-
compare();
Pregunta 168
Pregunta
168. Which of the following adds one string to the end of another?
Respuesta
-
strcat();
-
append();
-
stradd();
-
stringadd();
Pregunta 169
Pregunta
169. Which of the following correctly declares an array?
Respuesta
-
int anarray[10];
-
int anarray;
-
anarray{10};
-
array anarray[10];
Pregunta 170
Pregunta
170. What is the index number of the last element of an array with 29 elements?
Pregunta 171
Pregunta
171. Which of the following is a two-dimensional array?
Respuesta
-
int anarray[20][20];
-
array anarray[20][20];
-
int array[20, 20];
-
char array[20];
Pregunta 172
Pregunta
172. Which of the following correctly accesses the seventh element stored in foo, an array with 100
elements?
Pregunta 173
Pregunta
173. Which of the following accesses a variable in structure b?
Respuesta
-
b.var
-
b->var
-
b-var
-
b>var
Pregunta 174
Pregunta
174. Which of the following accesses a variable in structure *b?
Respuesta
-
b->var
-
b.var
-
b-var
-
b>var
Pregunta 175
Pregunta
175. Which of the following is a properly defined struct?
Pregunta 176
Pregunta
176. Which properly declares a variable of struct foo?
Respuesta
-
foo var
-
struct foo
-
foo
-
int foo
Pregunta 177
Pregunta
177. Which of the following is the proper declaration of a pointer?
Respuesta
-
int *x;
-
int &x;
-
ptr x;
-
int x;
Pregunta 178
Pregunta
178. Which of the following gives the memory address of integer variable a?
Pregunta 179
Pregunta
179. Which of the following gives the value stored at the address pointed to by the pointer a?
Pregunta 180
Pregunta
180. Which of the following is the proper keyword to allocate memory?
Pregunta 181
Pregunta
1. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << ( b * a + c *d --);
Pregunta 182
Pregunta
181. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << (++d);
Pregunta 183
Pregunta
182. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << (c = d + c++);
Pregunta 184
Pregunta
183. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << (c = d + ++c);
Pregunta 185
Pregunta
2. In a class definition, the special method provided to be called to create an instance of that
class is known as a/an
Respuesta
-
Constructor
-
Destructor
-
Object
-
Compiler
Pregunta 186
Pregunta
184. ……………….. are used to document a program and improve its readability.
Respuesta
-
Comments
-
Keywords
-
Control structures
-
Blocks
Pregunta 187
Pregunta
185. Members of a class specified as ……………….. are accessible only to methods of that
class.
Respuesta
-
private
-
public
-
protected
-
none of them
Pregunta 188
Pregunta
186. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << ( --b * a + c *d --);
Pregunta 189
Pregunta
187. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << (a++);
Pregunta 190
Pregunta
188. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
cout << (c = c++);
Pregunta 191
Pregunta
189. Identify, from among the following, the incorrect variable name
Pregunta 192
Pregunta
190. An overloaded method consists of:
i) The same method name with different types of parameters
ii) The same method name with different number of parameters
iii) The same method name and same number and type of parameters
Respuesta
-
Both i and ii
-
all of them
-
none of them
-
only i
Pregunta 193
Pregunta
191. You read the following statement in a C++ program that compiles and executes.
submarine.dive(depth);
What can you say for sure?
Pregunta 194
Pregunta
192. What is the type and value of the following expression?
- 4 + 1/2 + 2*-3 + 5.0
Respuesta
-
double -5.0
-
int -5
-
double -4.5
-
none of the above
Pregunta 195
Pregunta
193. What is printed by the following statement?
cout << (“Hello,\nworld!”);
Respuesta
-
Hello,
world!
-
Hello, \nworld!
-
Hello, world
-
“Hello, \nworld!”
Pregunta 196
Pregunta
194. Which of the following variable declaration would NOT compile in a java program?
Respuesta
-
int 1_var;
-
int var_1;
-
int var;
-
int VAR;
Pregunta 197
Pregunta
3. _________ is a paradigm based on the concepts of “object” that contains data and methods
Respuesta
-
Object-oriented programming
-
Object-based programming
-
Data-oriented programming
-
Method-oriented programming
Pregunta 198
Pregunta
195. Two or more methods with same name in the same class with different arguments is called as
Respuesta
-
Method overloading
-
Method overriding
-
Method overridden
-
none of the above
Pregunta 199
Pregunta
196. Constructors are used to
Pregunta 200
Pregunta
197. Syntax of loop
for (declaration; condition; increment/decrement){}