Programmaing Languages and Technologies

Beschreibung

Olzhas
Айдана Шырманбай
Quiz von Айдана Шырманбай, aktualisiert more than 1 year ago
Айдана Шырманбай
Erstellt von Айдана Шырманбай vor etwa 5 Jahre
397
5

Zusammenfassung der Ressource

Frage 1

Frage
1. Specify the types of operator
Antworten
  • Logical, Bitwise, Arithmetic, Relational
  • Mathematical, Bitwise, Arithmetic, Relational
  • Assignment, Bitwise, Arithmetic, Relational
  • Logical, Bitwise, Assignment, Relational

Frage 2

Frage
2. Logical operators always evaluated from
Antworten
  • Left to right
  • No difference
  • Not sure
  • Right to left

Frage 3

Frage
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:
Antworten
  • Arithmetic, comparison, logical
  • Comparison, logical, arithmetic
  • Logical, arithmetic, comparison
  • Arithmetic, logical, comparison

Frage 4

Frage
4. Precedence for Logical Operators
Antworten
  • NOT, AND, OR
  • OR, AND, NOT
  • OR, NOT, AND
  • AND, OR, NOT

Frage 5

Frage
5. What is an array?
Antworten
  • 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.

Frage 6

Frage
6. When an array is partially initialized, the rest of its elements will automatically be set to zero
Antworten
  • False
  • True
  • Nothing
  • All of them

Frage 7

Frage
7. The whole array can be passed to a function. However, it can't be changed by the code in that function
Antworten
  • False
  • All of them
  • Nothing
  • True

Frage 8

Frage
8. What are the three steps in using a function?
Antworten
  • Definition, prototype, invocation
  • Prototype, argument, signature
  • Definition, invocation, argument

Frage 9

Frage
9. write mpg() function prototype, that takes two type double arguments and returns a double
Antworten
  • Double mpg(double a, double b)
  • Void mpg(){}
  • Float mpg(int a){ float b = 1; return b;}
  • Double mpg(int a, double b)

Frage 10

Frage
10. What is data structure?
Antworten
  • 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.

Frage 11

Frage
11. The data elements in structure are also known as what?
Antworten
  • Members
  • Data
  • Objects
  • None of the above

Frage 12

Frage
12. What will be used when terminating a structure?
Antworten
  • Semicolon
  • Colon
  • Brackets
  • Dot

Frage 13

Frage
13. Which stream class is used to both read and write on files?
Antworten
  • Fstream
  • Iostream
  • Ofstream
  • Ifstream

Frage 14

Frage
14. Which stream class is only used to read files
Antworten
  • Ifstream
  • Ofstream
  • Iostream
  • Fstream

Frage 15

Frage
15. What is the difference between array and structure?
Antworten
  • Structure can include members of different data types
  • No difference
  • Only on their declaration
  • Arrays can include only integers

Frage 16

Frage
16. What is the output from the following program code?
Antworten
  • 10 10 10 10 10
  • 11 11 11 11 11
  • 10
  • 0 1 2 3 4
  • Error

Frage 17

Frage
17. The OR (||) operator:
Antworten
  • 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

Frage 18

Frage
18. Which of the following for headers is not valid for C++ code?
Antworten
  • 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

Frage 19

Frage
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?
Antworten
  • Function overloading
  • Function overprocessing
  • Argument type error
  • Argument dispatch error

Frage 20

Frage
20. Which of the following cannot be used to create a random numbers?
Antworten
  • structures
  • float
  • int
  • none of the mentioned

Frage 21

Frage
21. Please evaluate !(1 && !(0 || 1)).
Antworten
  • True
  • False
  • Unevaluatable
  • Not sure

Frage 22

Frage
22. What is the final value of x when the code int x; for(x=0; x<50; x++) {} is run?
Antworten
  • 10
  • 50
  • 0
  • 51

Frage 23

Frage
23. How many times is a do while loop guaranteed to loop?
Antworten
  • 0
  • Infinitely
  • 1
  • Variable

Frage 24

Frage
24. What is the output of the following code?
Antworten
  • value
  • 77.5
  • Float
  • Variable

Frage 25

Frage
25. Which of the following is a valid function call (assuming the function exists)?
Antworten
  • funct;
  • funct x, y;
  • funct();
  • struct funct();

Frage 26

Frage
26. Which of the following is a complete function?
Antworten
  • int funct();
  • int funct(int x) {return x=x+1;}
  • void funct[int] {cout&tl;<"Hello"}
  • void funct{x} {cout<<"Hello"}

Frage 27

Frage
27. Which of the following is required to avoid falling through from one case to the next?
Antworten
  • End;
  • Break;
  • Stop;
  • A semicolon;

Frage 28

Frage
28. Which of the following is the proper declaration of a pointer?
Antworten
  • int x;
  • int &x;
  • ptr x;
  • int *x;

Frage 29

Frage
29. Which of the following gives the memory address of integer variable a?
Antworten
  • *a;
  • a;
  • &a;
  • address(a);

Frage 30

Frage
30. Which of the following gives the memory address of a pointer a?
Antworten
  • a;
  • *a;
  • &a;
  • address(a);

Frage 31

Frage
31. Which of the following gives the value stored at the address pointed to by the pointer a?
Antworten
  • a;
  • val(a);
  • *a;
  • &a;

Frage 32

Frage
32. Which of the following gives the value stored at the address pointed to by the pointer ptr?
Antworten
  • ptr;
  • val(ptr);
  • *ptr;
  • &ptr;

Frage 33

Frage
33. Which of the following accesses a variable in structure b?
Antworten
  • b->var;
  • b.var;
  • b-var;
  • b>var;

Frage 34

Frage
34. Which of the following accesses a variable in structure mystruct?
Antworten
  • mystruct ->var;
  • mystruct.var;
  • mystruct -var;
  • mystruct >var;

Frage 35

Frage
35. Which of the following correctly accesses the seventh element stored in diana, an array with 100 elements?
Antworten
  • diana[6]
  • diana[7]
  • diana(7)
  • diana;

Frage 36

Frage
36. What is the correct way to write the condition y < x < z?
Antworten
  • ((y < x) && (x < z))
  • ((y < x) || (x < z))
  • ((y < x) & (x < z))
  • ((y < x) AN (x < z))

Frage 37

Frage
37. The value 132.54 can represented using which data type?
Antworten
  • Double
  • Void
  • Integer
  • Bool

Frage 38

Frage
38. In an assignment statement “ a=b; ” which of the following statement is true?
Antworten
  • 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.

Frage 39

Frage
39. The difference between while structure and do structure for looping is
Antworten
  • 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

Frage 40

Frage
40. A function that calls itself for its processing is known as
Antworten
  • Inline Function
  • Nested Function
  • Overloaded Function
  • Recursive Function

Frage 41

Frage
41. The keyword endl
Antworten
  • 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

Frage 42

Frage
42. Strings are character arrays. The last index of it contains the nullterminated character
Antworten
  • \n
  • \t
  • \0
  • \1

Frage 43

Frage
43. Variables inside parenthesis of functions declarations have _____ level access
Antworten
  • Local
  • Global
  • Module
  • Universal

Frage 44

Frage
44. Array indexing always starts with the number
Antworten
  • 0
  • 1
  • -1
  • 10

Frage 45

Frage
45. Which of the following accesses a variable in structure st1?
Antworten
  • st1->var;
  • st1.var;
  • st1-var;
  • st1>var;

Frage 46

Frage
46. Which looping process is best used when the number of iterations is known?
Antworten
  • For
  • While
  • Do-while
  • Nothing

Frage 47

Frage
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?
Antworten
  • parentheses ( )
  • braces { }
  • brackets [ ]
  • arrows < >

Frage 48

Frage
48. A memory address is…
Antworten
  • where a variable is stored.
  • where a variable is defined.
  • where a variable is declares.
  • where a variable is print out.

Frage 49

Frage
49. The set of instructions that a computer will follow is known as..
Antworten
  • program
  • variable
  • computer
  • brackets

Frage 50

Frage
50. cin >> number; is
Antworten
  • an output statement
  • a colon
  • a variable
  • an input statement

Frage 51

Frage
51. cout << "How many items would you want?\n"; is
Antworten
  • an output statement
  • a colon
  • a variable
  • an input statement

Frage 52

Frage
52. int number; is
Antworten
  • an output statement
  • a variable declaration
  • a variable
  • an input statement

Frage 53

Frage
53. If x is 0, what is the value of (!x == 0)?
Antworten
  • True
  • False
  • 2
  • 15

Frage 54

Frage
54. How to create array with n integers?
Antworten
  • 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];

Frage 55

Frage
55. Which class should be included to work with files?
Antworten
  • iostream
  • string
  • cmath
  • fstream

Frage 56

Frage
56. Which of the following is the output from the following C++ code?
Antworten
  • 15 14 13 12 11 10
  • 15 14 13 12 11 10 9
  • 9
  • 15

Frage 57

Frage
57. If originally x=0, y=1, and z=3, what is the value of x, y, and z after executing the following code ?
Antworten
  • x=0 y=3 z=3
  • x=0 y=1 z=3
  • x=3 y=3 z=3
  • x=3 y=1 z=0

Frage 58

Frage
58. What is the value of x after the following statements?
Antworten
  • 10
  • 33
  • 3
  • 0

Frage 59

Frage
59. What is the value of x after the following statements?
Antworten
  • 15
  • 3
  • 4
  • 0

Frage 60

Frage
60. Which of the following is the output from the following C++?
Antworten
  • 5
  • 0
  • 4
  • 6

Frage 61

Frage
61. Given the following code fragment, what is the final value of y?
Antworten
  • 8
  • 2
  • 4
  • 3

Frage 62

Frage
62. Which of the following is the output from the following C++ code
Antworten
  • 10
  • 12
  • 3
  • 4

Frage 63

Frage
64. Which of the following is the final value of y from the following C++ code
Antworten
  • 2
  • 3
  • 22
  • 0

Frage 64

Frage
63. Which of the following is the output from the following C++ code?
Antworten
  • 6
  • 0
  • 4
  • 5

Frage 65

Frage
65. Which of the following is the final value of ‘i’ from the following C++ code ?
Antworten
  • 5
  • 4
  • 0 1 2 3 4
  • 0 1 2 3 4 5

Frage 66

Frage
66. What is the value of x after the following code executes?
Antworten
  • 10
  • 11
  • 13
  • 0

Frage 67

Frage
67. Given the following code, what is the final value of i?
Antworten
  • 2
  • 4
  • 3
  • 0

Frage 68

Frage
68. What is the value of x after the following code executes?
Antworten
  • 10
  • 11
  • 13
  • 0

Frage 69

Frage
69. What is the output of the following code segment?
Antworten
  • 15
  • 25
  • 5
  • 0

Frage 70

Frage
70. What does the following code print to the screen?
Antworten
  • 7
  • cout
  • int
  • world

Frage 71

Frage
71. What is the value of x after the following statements?
Antworten
  • 15
  • 10
  • 5
  • 25

Frage 72

Frage
72. What is the value of x after the following statements?
Antworten
  • 25
  • 4
  • 5
  • 1

Frage 73

Frage
73. What is the value of x after the following code executes?
Antworten
  • 10
  • 11
  • 23
  • 13

Frage 74

Frage
74. Given the following code, what is the final value of i?
Antworten
  • 5
  • 2
  • 3
  • 0

Frage 75

Frage
75. Given the following code, what is the final value of i?
Antworten
  • 4
  • 6
  • 5
  • 0

Frage 76

Frage
76. Which of the following is the valid array declaration
Antworten
  • int num(5)
  • int mycat[5]
  • Array. double[5] marks
  • Myarray.counter int[5]

Frage 77

Frage
77. What is the output of the following code?
Antworten
  • 7
  • Value
  • 1
  • 6

Frage 78

Frage
78. What is the value of x after the following statements ?
Antworten
  • 11
  • 10
  • 0
  • 12

Frage 79

Frage
79. What is the final output of the following code fragment ?
Antworten
  • 22
  • 23
  • 20
  • 0

Frage 80

Frage
80. Solve the following piece of code and choose the best answer?
Antworten
  • The function addition is called by passing the values
  • The function addition is called by passing reference
  • Both of above
  • None of above

Frage 81

Frage
81. If the type specifies of parameters of a function is followed by an ampersand &, that function call is…
Antworten
  • Pass by value
  • Pass by reference
  • All of answers
  • None of answers

Frage 82

Frage
82. Which of the following gives the memory address of a pointer pt1?
Antworten
  • *pt1;
  • pt1;
  • &pt1;
  • address(ptr1);

Frage 83

Frage
83. What is the value of x after the following statement?
Antworten
  • 1.75
  • 50
  • 30
  • 20

Frage 84

Frage
84. What is the final value of x after the following fragment of codeexecutes ?
Antworten
  • Infinite loop
  • Never
  • 1
  • 0

Frage 85

Frage
85. What is the value of x after the following statement?
Antworten
  • 3.75
  • 1.75
  • 2
  • 0

Frage 86

Frage
86. What is the value of x after the following statements ?
Antworten
  • 7
  • 10
  • 3
  • 33

Frage 87

Frage
87. What is the value of x after the following statements?
Antworten
  • 70
  • 30
  • 3
  • 33

Frage 88

Frage
88. Given the following code fragment, what is the output
Antworten
  • 5
  • That is all. Goodbye
  • X is bigger than 5
  • X

Frage 89

Frage
89. How many times is "Hi" printed to the screen ?
Antworten
  • 0
  • 1
  • 14
  • 15

Frage 90

Frage
90. How to read file and take first string?
Antworten

Frage 91

Frage
91. How to write to file?
Antworten

Frage 92

Frage
92. There is given array with n elements, created as pointer. How to remove it correctly?
Antworten
  • delete a;
  • delete[] a;
  • remove[] a;
  • remove a;

Frage 93

Frage
93. How to write correct recursive function for making sum of n numbers?

Frage 94

Frage
94. How to make several items in structure? Just think that you have “HOME”, and n items in it

Frage 95

Frage
95. Find mistake of next cod ?
Antworten
  • 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.

Frage 96

Frage
96. What will print in command line next code ?
Antworten
  • 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.

Frage 97

Frage
97. Which one will be correct function for ?

Frage 98

Frage
98. There are given array “numbers” with 10 numbers. How to make sum of all numbers, which are located in odd indexes?

Frage 99

Frage
99. There is given string named “str”. How to print in command line length of str?
Antworten
  • cout << str.count();
  • cout << str.length;
  • cout << str.lenth();
  • cout >> str.lenth();

Frage 100

Frage
100. How to implement array of chars with 10 elements?
Antworten
  • char* chs; chs = new char(10);
  • char chs; chs = char[10];
  • char chs[10];
  • char chs[] = new char[10];

Frage 101

Frage
101. How to implement array of integer numbers with n elements, and how to delete them correctly?
Antworten
  • 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;

Frage 102

Frage
102. How to get whole string in one line (in command line)?
Antworten
  • string s; getline(cin, s);
  • string s; getline(cout, s);
  • string s; cin >> s;
  • string s; cout << s;

Frage 103

Frage
103. How to get whole string in one line (in file)?
Antworten
  • 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;

Frage 104

Frage
104. Why do we need library?
Antworten
  • To work with strings.
  • To work with files.
  • To work with mathematical functions.
  • To work with our own libraries.

Frage 105

Frage
105. Why do we need library <cmath>?
Antworten
  • To work with strings.
  • To work with mathematical functions.
  • To work with command line.
  • To work with our own libraries.

Frage 106

Frage
106. Where is the mistake of the code ?
Antworten
  • Variable “a” do not have any values.
  • Library didn’t included.
  • Library didn’t included.
  • Library didn’t included

Frage 107

Frage
107. What will be printed in the part of the cod?
Antworten
  • 1 4 7 10
  • 0 3 6 9
  • 3 6 9
  • 9 6 3 0

Frage 108

Frage
108. What will be printed in the part of the code?
Antworten
  • 0 8 16 24 32
  • 2 10 18 26 34
  • 6 12 20 28 36
  • 4 10 18 26 34

Frage 109

Frage
109. Which of the following is the proper keyword to allocate memory?
Antworten
  • new
  • malloc
  • create
  • value

Frage 110

Frage
110. Which of the following is the proper keyword to deallocate memory?
Antworten
  • free
  • delete
  • clear
  • remove

Frage 111

Frage
111. Assume if A = 10; and B = 15; with using bitwise OR operator Find A||B
Antworten
  • 10
  • 15
  • 61
  • 13

Frage 112

Frage
112. The notation of logical NOT operator in a C++ program is
Antworten
  • !
  • :
  • ;
  • None of above

Frage 113

Frage
113. Which of the following denote C++ looping statement?
Antworten
  • All of them
  • for
  • while
  • do-while

Frage 114

Frage
Cin in C++ program uses the operator
Antworten
  • >>
  • <<
  • >
  • ||

Frage 115

Frage
What is the minimum number of times a do loop would definitely get executed?
Antworten
  • 1
  • inf
  • 0
  • None of the above

Frage 116

Frage
The function named as exforsys declared as int exforsys(float x, double y) has return type as
Antworten
  • int
  • char
  • double
  • string

Frage 117

Frage
Which of the following is mandatory for all C++ program?
Antworten
  • main()
  • void()
  • system()
  • None of the above

Frage 118

Frage
Which of the following denote newline character in C++ program?
Antworten
  • “\n”
  • end
  • “/n”
  • enl

Frage 119

Frage
Which of the following is used to group a set of objects and functions under a name?
Antworten
  • namespace
  • name
  • namearea
  • areaname

Frage 120

Frage
What is the notation used to place block of statements in a looping structure in C++?
Antworten
  • { }
  • [ ]
  • ( )
  • " "

Frage 121

Frage
What is the notation used show the size of array?
Antworten
  • [ ]
  • { }
  • ( )
  • " "

Frage 122

Frage
How many values can be returned by a C++ function?
Antworten
  • 1
  • Inf
  • 0
  • None of the above

Frage 123

Frage
123. Which of the following is returned by the system if a C++ program completes successfully?
Antworten
  • 0
  • 1
  • -1
  • Inf

Frage 124

Frage
124. The variables that can be used only within the function in which it is declared is called as
Antworten
  • local
  • global
  • both of them
  • none of them

Frage 125

Frage
125. Comments in C++ program is written by using
Antworten
  • //
  • --
  • <!-->
  • <>

Frage 126

Frage
126. The array exforsys[10] can be declared using pointers as
Antworten
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Frage 127

Frage
127. Default size of int in c++ (in bytes)
Antworten
  • 4
  • 8
  • 16
  • 2

Frage 128

Frage
128. Default size of double in c++ (in bytes)
Antworten
  • 16
  • 8
  • 4
  • 2

Frage 129

Frage
129. Default value of boolean
Antworten
  • false
  • true

Frage 130

Frage
130. If a function in C++ does not return a value then its return type is denoted as
Antworten
  • void
  • int
  • double
  • bool

Frage 131

Frage
131. A user defined header file is included by following statement in general.
Antworten
  • #include "file.h"
  • #include <file.h>
  • #include file.h
  • #include <file>

Frage 132

Frage
132. An inline function can execute faster than a normal function.
Antworten
  • True
  • False

Frage 133

Frage
133. What value must a destructor return?
Antworten
  • Destructors do not return a value.
  • A pointer to the class.
  • An object of the class.
  • A status code determining whether the class was destructed correctly

Frage 134

Frage
134. What character ends all strings?
Antworten
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Frage 135

Frage
135. Which of the following reads in a string named x with one hundred characters?
Antworten
  • cin.getline(x, 100, &#39;\n&#39;);
  • cin.getline(100, x, &#39;\n&#39;);
  • readline(x, 100, &#39;\n&#39;);
  • read(x);

Frage 136

Frage
136. Which of the following functions compares two strings?
Antworten
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Frage 137

Frage
137. Which of the following adds one string to the end of another?
Antworten
  • strcat();
  • append();
  • stradd();
  • stringadd();

Frage 138

Frage
138. Which of the following correctly declares an array?
Antworten
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Frage 139

Frage
139. What is the index number of the last element of an array with 29 elements?
Antworten
  • 28
  • 29
  • 0
  • 27

Frage 140

Frage
140. Which of the following is a two-dimensional array?
Antworten
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Frage 141

Frage
141. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
Antworten
  • foo[6]
  • foo[7]
  • foo(6)
  • foo

Frage 142

Frage
142. Which of the following accesses a variable in structure b?
Antworten
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Frage 143

Frage
143. Which of the following accesses a variable in structure *b?
Antworten
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Frage 144

Frage
144. Which of the following is a properly defined struct?
Antworten
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Frage 145

Frage
145. Which properly declares a variable of struct foo?
Antworten
  • foo var
  • struct foo
  • foo
  • int foo

Frage 146

Frage
146. Which of the following is the proper declaration of a pointer?
Antworten
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Frage 147

Frage
147. Which of the following gives the memory address of integer variable a?
Antworten
  • &amp;a;
  • *a;
  • address(a);
  • a;

Frage 148

Frage
148. Which of the following gives the value stored at the address pointed to by the pointer a?
Antworten
  • *a;
  • &amp;a;
  • a;
  • val(a);

Frage 149

Frage
149. Which of the following is the proper keyword to allocate memory?
Antworten
  • new
  • malloc
  • create
  • value

Frage 150

Frage
150. Which of the following is the proper keyword to deallocate memory?
Antworten
  • delete
  • clear
  • remove
  • free

Frage 151

Frage
151. What is the notation used to place block of statements in a looping structure in C++?
Antworten
  • { }
  • [ ]
  • ( )
  • " "

Frage 152

Frage
152. What is the notation used show the size of array?
Antworten
  • [ ]
  • { }
  • ( )
  • " "

Frage 153

Frage
153. How many values can be returned by a C++ function?
Antworten
  • 1
  • Inf
  • 0
  • None of the above

Frage 154

Frage
154. Which of the following is returned by the system if a C++ program completes successfully?
Antworten
  • 0
  • 1
  • -1
  • Inf

Frage 155

Frage
155. The variables that can be used only within the function in which it is declared is called as
Antworten
  • local
  • global
  • both of them
  • none of them

Frage 156

Frage
156. Comments in C++ program is written by using
Antworten
  • //
  • --
  • <!-->
  • <>

Frage 157

Frage
157. The array exforsys[10] can be declared using pointers as
Antworten
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Frage 158

Frage
158. Default size of int in c++ (in bytes)
Antworten
  • 4
  • 8
  • 16
  • 2

Frage 159

Frage
159. Default size of double in c++ (in bytes)
Antworten
  • 16
  • 8
  • 4
  • 2

Frage 160

Frage
160. Default value of boolean
Antworten
  • false
  • true

Frage 161

Frage
161. If a function in C++ does not return a value then its return type is denoted as
Antworten
  • void
  • int
  • double
  • bool

Frage 162

Frage
162. A user defined header file is included by following statement in general.
Antworten
  • #include “file.h”
  • #include <file.h>
  • #include file.h
  • #include <file>

Frage 163

Frage
163. An inline function can execute faster than a normal function.
Antworten
  • True
  • False

Frage 164

Frage
164. What value must a destructor return?
Antworten
  • Destructors do not return a value.
  • A pointer to the class.
  • An object of the class.
  • A status code determining whether the class was destructed correctly

Frage 165

Frage
165. What character ends all strings?
Antworten
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Frage 166

Frage
166. Which of the following reads in a string named x with one hundred characters?
Antworten
  • cin.getline(x, 100, &#39;\n&#39;);
  • cin.getline(100, x, &#39;\n&#39;);
  • readline(x, 100, &#39;\n&#39;);
  • read(x);

Frage 167

Frage
167. Which of the following functions compares two strings?
Antworten
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Frage 168

Frage
168. Which of the following adds one string to the end of another?
Antworten
  • strcat();
  • append();
  • stradd();
  • stringadd();

Frage 169

Frage
169. Which of the following correctly declares an array?
Antworten
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Frage 170

Frage
170. What is the index number of the last element of an array with 29 elements?
Antworten
  • 28
  • 29
  • 0
  • 27

Frage 171

Frage
171. Which of the following is a two-dimensional array?
Antworten
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Frage 172

Frage
172. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
Antworten
  • foo[6]
  • foo[7]
  • foo(6)
  • foo

Frage 173

Frage
173. Which of the following accesses a variable in structure b?
Antworten
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Frage 174

Frage
174. Which of the following accesses a variable in structure *b?
Antworten
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Frage 175

Frage
175. Which of the following is a properly defined struct?
Antworten
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Frage 176

Frage
176. Which properly declares a variable of struct foo?
Antworten
  • foo var
  • struct foo
  • foo
  • int foo

Frage 177

Frage
177. Which of the following is the proper declaration of a pointer?
Antworten
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Frage 178

Frage
178. Which of the following gives the memory address of integer variable a?
Antworten
  • &a;
  • *a;
  • address(a);
  • a;

Frage 179

Frage
179. Which of the following gives the value stored at the address pointed to by the pointer a?
Antworten
  • *a;
  • &amp;a;
  • a;
  • val(a);

Frage 180

Frage
180. Which of the following is the proper keyword to allocate memory?
Antworten
  • new
  • malloc
  • create
  • value

Frage 181

Frage
1. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; ( b * a + c *d --);
Antworten
  • 26
  • 24
  • 22
  • 28

Frage 182

Frage
181. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (++d);
Antworten
  • 6
  • 5
  • 1
  • 4

Frage 183

Frage
182. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = d + c++);
Antworten
  • 9
  • 10
  • 8
  • 4

Frage 184

Frage
183. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = d + ++c);
Antworten
  • 10
  • 9
  • 4
  • 8

Frage 185

Frage
2. In a class definition, the special method provided to be called to create an instance of that class is known as a/an
Antworten
  • Constructor
  • Destructor
  • Object
  • Compiler

Frage 186

Frage
184. ……………….. are used to document a program and improve its readability.
Antworten
  • Comments
  • Keywords
  • Control structures
  • Blocks

Frage 187

Frage
185. Members of a class specified as ……………….. are accessible only to methods of that class. 
Antworten
  • private
  • public
  • protected
  • none of them

Frage 188

Frage
186. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; ( --b * a + c *d --);
Antworten
  • 24
  • 21
  • 22
  • 28

Frage 189

Frage
187. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (a++);
Antworten
  • 2
  • 1
  • Syntax error
  • 3

Frage 190

Frage
188. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = c++);
Antworten
  • 4
  • 5
  • 8
  • 2

Frage 191

Frage
189. Identify, from among the following, the incorrect variable name
Antworten
  • 2ndName
  • _theButton
  • my2ndFont.
  • CurrentWeatherStateofplanet

Frage 192

Frage
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
Antworten
  • Both i and ii
  • all of them
  • none of them
  • only i

Frage 193

Frage
191. You read the following statement in a C++ program that compiles and executes. submarine.dive(depth); What can you say for sure?
Antworten
  • dive must be a method.
  • depth must be an int
  • submarine must be the name of a class
  • submarine must be a method.

Frage 194

Frage
192. What is the type and value of the following expression? - 4 + 1/2 + 2*-3 + 5.0
Antworten
  • double -5.0
  • int -5
  • double -4.5
  • none of the above

Frage 195

Frage
193. What is printed by the following statement? cout &lt;&lt; (“Hello,\nworld!”);
Antworten
  • Hello, world!
  • Hello, \nworld!
  • Hello, world
  • “Hello, \nworld!”

Frage 196

Frage
194. Which of the following variable declaration would NOT compile in a java program?
Antworten
  • int 1_var;
  • int var_1;
  • int var;
  • int VAR;

Frage 197

Frage
3. _________ is a paradigm based on the concepts of “object” that contains data and methods
Antworten
  • Object-oriented programming
  • Object-based programming
  • Data-oriented programming
  • Method-oriented programming

Frage 198

Frage
195. Two or more methods with same name in the same class with different arguments is called as
Antworten
  • Method overloading
  • Method overriding
  • Method overridden
  • none of the above

Frage 199

Frage
196. Constructors are used to
Antworten
  • Initialize a newly create object.
  • Free memory
  • To create a subclass
  • To build a user interface

Frage 200

Frage
197. Syntax of loop for (declaration; condition; increment/decrement){}
Antworten
  • False
  • True
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

State & Local Govt - Budgetary Accounting
turquoise_cat
Liberalism Mindmap
floragair
3. Describe the state of nature for Hobbes, Locke, and Rousseau.
Elisabeth Morell
Woody, Alternate, Simple, Families F-R
Wes Smalley
body parts and sickness
Ambre Badipi
types of economy
Jesse McNab
War on Terror
Wesley Spearman
React siblings components
Kostas Diakogiannis
Liberalism Mindmap
hollie garner
United States Capitals
Rob Perry
Secularism
Selective Study