Programmaing Languages and Technologies

Descrição

Olzhas
Айдана Шырманбай
Quiz por Айдана Шырманбай, atualizado more than 1 year ago
Айдана Шырманбай
Criado por Айдана Шырманбай aproximadamente 5 anos atrás
397
5

Resumo de Recurso

Questão 1

Questão
1. Specify the types of operator
Responda
  • Logical, Bitwise, Arithmetic, Relational
  • Mathematical, Bitwise, Arithmetic, Relational
  • Assignment, Bitwise, Arithmetic, Relational
  • Logical, Bitwise, Assignment, Relational

Questão 2

Questão
2. Logical operators always evaluated from
Responda
  • Left to right
  • No difference
  • Not sure
  • Right to left

Questão 3

Questão
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:
Responda
  • Arithmetic, comparison, logical
  • Comparison, logical, arithmetic
  • Logical, arithmetic, comparison
  • Arithmetic, logical, comparison

Questão 4

Questão
4. Precedence for Logical Operators
Responda
  • NOT, AND, OR
  • OR, AND, NOT
  • OR, NOT, AND
  • AND, OR, NOT

Questão 5

Questão
5. What is an array?
Responda
  • 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.

Questão 6

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

Questão 7

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

Questão 8

Questão
8. What are the three steps in using a function?
Responda
  • Definition, prototype, invocation
  • Prototype, argument, signature
  • Definition, invocation, argument

Questão 9

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

Questão 10

Questão
10. What is data structure?
Responda
  • 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.

Questão 11

Questão
11. The data elements in structure are also known as what?
Responda
  • Members
  • Data
  • Objects
  • None of the above

Questão 12

Questão
12. What will be used when terminating a structure?
Responda
  • Semicolon
  • Colon
  • Brackets
  • Dot

Questão 13

Questão
13. Which stream class is used to both read and write on files?
Responda
  • Fstream
  • Iostream
  • Ofstream
  • Ifstream

Questão 14

Questão
14. Which stream class is only used to read files
Responda
  • Ifstream
  • Ofstream
  • Iostream
  • Fstream

Questão 15

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

Questão 16

Questão
16. What is the output from the following program code?
Responda
  • 10 10 10 10 10
  • 11 11 11 11 11
  • 10
  • 0 1 2 3 4
  • Error

Questão 17

Questão
17. The OR (||) operator:
Responda
  • 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

Questão 18

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

Questão 19

Questão
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?
Responda
  • Function overloading
  • Function overprocessing
  • Argument type error
  • Argument dispatch error

Questão 20

Questão
20. Which of the following cannot be used to create a random numbers?
Responda
  • structures
  • float
  • int
  • none of the mentioned

Questão 21

Questão
21. Please evaluate !(1 && !(0 || 1)).
Responda
  • True
  • False
  • Unevaluatable
  • Not sure

Questão 22

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

Questão 23

Questão
23. How many times is a do while loop guaranteed to loop?
Responda
  • 0
  • Infinitely
  • 1
  • Variable

Questão 24

Questão
24. What is the output of the following code?
Responda
  • value
  • 77.5
  • Float
  • Variable

Questão 25

Questão
25. Which of the following is a valid function call (assuming the function exists)?
Responda
  • funct;
  • funct x, y;
  • funct();
  • struct funct();

Questão 26

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

Questão 27

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

Questão 28

Questão
28. Which of the following is the proper declaration of a pointer?
Responda
  • int x;
  • int &x;
  • ptr x;
  • int *x;

Questão 29

Questão
29. Which of the following gives the memory address of integer variable a?
Responda
  • *a;
  • a;
  • &a;
  • address(a);

Questão 30

Questão
30. Which of the following gives the memory address of a pointer a?
Responda
  • a;
  • *a;
  • &a;
  • address(a);

Questão 31

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

Questão 32

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

Questão 33

Questão
33. Which of the following accesses a variable in structure b?
Responda
  • b->var;
  • b.var;
  • b-var;
  • b>var;

Questão 34

Questão
34. Which of the following accesses a variable in structure mystruct?
Responda
  • mystruct ->var;
  • mystruct.var;
  • mystruct -var;
  • mystruct >var;

Questão 35

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

Questão 36

Questão
36. What is the correct way to write the condition y < x < z?
Responda
  • ((y < x) && (x < z))
  • ((y < x) || (x < z))
  • ((y < x) & (x < z))
  • ((y < x) AN (x < z))

Questão 37

Questão
37. The value 132.54 can represented using which data type?
Responda
  • Double
  • Void
  • Integer
  • Bool

Questão 38

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

Questão 39

Questão
39. The difference between while structure and do structure for looping is
Responda
  • 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

Questão 40

Questão
40. A function that calls itself for its processing is known as
Responda
  • Inline Function
  • Nested Function
  • Overloaded Function
  • Recursive Function

Questão 41

Questão
41. The keyword endl
Responda
  • 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

Questão 42

Questão
42. Strings are character arrays. The last index of it contains the nullterminated character
Responda
  • \n
  • \t
  • \0
  • \1

Questão 43

Questão
43. Variables inside parenthesis of functions declarations have _____ level access
Responda
  • Local
  • Global
  • Module
  • Universal

Questão 44

Questão
44. Array indexing always starts with the number
Responda
  • 0
  • 1
  • -1
  • 10

Questão 45

Questão
45. Which of the following accesses a variable in structure st1?
Responda
  • st1->var;
  • st1.var;
  • st1-var;
  • st1>var;

Questão 46

Questão
46. Which looping process is best used when the number of iterations is known?
Responda
  • For
  • While
  • Do-while
  • Nothing

Questão 47

Questão
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?
Responda
  • parentheses ( )
  • braces { }
  • brackets [ ]
  • arrows < >

Questão 48

Questão
48. A memory address is…
Responda
  • where a variable is stored.
  • where a variable is defined.
  • where a variable is declares.
  • where a variable is print out.

Questão 49

Questão
49. The set of instructions that a computer will follow is known as..
Responda
  • program
  • variable
  • computer
  • brackets

Questão 50

Questão
50. cin >> number; is
Responda
  • an output statement
  • a colon
  • a variable
  • an input statement

Questão 51

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

Questão 52

Questão
52. int number; is
Responda
  • an output statement
  • a variable declaration
  • a variable
  • an input statement

Questão 53

Questão
53. If x is 0, what is the value of (!x == 0)?
Responda
  • True
  • False
  • 2
  • 15

Questão 54

Questão
54. How to create array with n integers?
Responda
  • 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];

Questão 55

Questão
55. Which class should be included to work with files?
Responda
  • iostream
  • string
  • cmath
  • fstream

Questão 56

Questão
56. Which of the following is the output from the following C++ code?
Responda
  • 15 14 13 12 11 10
  • 15 14 13 12 11 10 9
  • 9
  • 15

Questão 57

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

Questão 58

Questão
58. What is the value of x after the following statements?
Responda
  • 10
  • 33
  • 3
  • 0

Questão 59

Questão
59. What is the value of x after the following statements?
Responda
  • 15
  • 3
  • 4
  • 0

Questão 60

Questão
60. Which of the following is the output from the following C++?
Responda
  • 5
  • 0
  • 4
  • 6

Questão 61

Questão
61. Given the following code fragment, what is the final value of y?
Responda
  • 8
  • 2
  • 4
  • 3

Questão 62

Questão
62. Which of the following is the output from the following C++ code
Responda
  • 10
  • 12
  • 3
  • 4

Questão 63

Questão
64. Which of the following is the final value of y from the following C++ code
Responda
  • 2
  • 3
  • 22
  • 0

Questão 64

Questão
63. Which of the following is the output from the following C++ code?
Responda
  • 6
  • 0
  • 4
  • 5

Questão 65

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

Questão 66

Questão
66. What is the value of x after the following code executes?
Responda
  • 10
  • 11
  • 13
  • 0

Questão 67

Questão
67. Given the following code, what is the final value of i?
Responda
  • 2
  • 4
  • 3
  • 0

Questão 68

Questão
68. What is the value of x after the following code executes?
Responda
  • 10
  • 11
  • 13
  • 0

Questão 69

Questão
69. What is the output of the following code segment?
Responda
  • 15
  • 25
  • 5
  • 0

Questão 70

Questão
70. What does the following code print to the screen?
Responda
  • 7
  • cout
  • int
  • world

Questão 71

Questão
71. What is the value of x after the following statements?
Responda
  • 15
  • 10
  • 5
  • 25

Questão 72

Questão
72. What is the value of x after the following statements?
Responda
  • 25
  • 4
  • 5
  • 1

Questão 73

Questão
73. What is the value of x after the following code executes?
Responda
  • 10
  • 11
  • 23
  • 13

Questão 74

Questão
74. Given the following code, what is the final value of i?
Responda
  • 5
  • 2
  • 3
  • 0

Questão 75

Questão
75. Given the following code, what is the final value of i?
Responda
  • 4
  • 6
  • 5
  • 0

Questão 76

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

Questão 77

Questão
77. What is the output of the following code?
Responda
  • 7
  • Value
  • 1
  • 6

Questão 78

Questão
78. What is the value of x after the following statements ?
Responda
  • 11
  • 10
  • 0
  • 12

Questão 79

Questão
79. What is the final output of the following code fragment ?
Responda
  • 22
  • 23
  • 20
  • 0

Questão 80

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

Questão 81

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

Questão 82

Questão
82. Which of the following gives the memory address of a pointer pt1?
Responda
  • *pt1;
  • pt1;
  • &pt1;
  • address(ptr1);

Questão 83

Questão
83. What is the value of x after the following statement?
Responda
  • 1.75
  • 50
  • 30
  • 20

Questão 84

Questão
84. What is the final value of x after the following fragment of codeexecutes ?
Responda
  • Infinite loop
  • Never
  • 1
  • 0

Questão 85

Questão
85. What is the value of x after the following statement?
Responda
  • 3.75
  • 1.75
  • 2
  • 0

Questão 86

Questão
86. What is the value of x after the following statements ?
Responda
  • 7
  • 10
  • 3
  • 33

Questão 87

Questão
87. What is the value of x after the following statements?
Responda
  • 70
  • 30
  • 3
  • 33

Questão 88

Questão
88. Given the following code fragment, what is the output
Responda
  • 5
  • That is all. Goodbye
  • X is bigger than 5
  • X

Questão 89

Questão
89. How many times is "Hi" printed to the screen ?
Responda
  • 0
  • 1
  • 14
  • 15

Questão 90

Questão
90. How to read file and take first string?
Responda

Questão 91

Questão
91. How to write to file?
Responda

Questão 92

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

Questão 93

Questão
93. How to write correct recursive function for making sum of n numbers?

Questão 94

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

Questão 95

Questão
95. Find mistake of next cod ?
Responda
  • 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.

Questão 96

Questão
96. What will print in command line next code ?
Responda
  • 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.

Questão 97

Questão
97. Which one will be correct function for ?

Questão 98

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

Questão 99

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

Questão 100

Questão
100. How to implement array of chars with 10 elements?
Responda
  • char* chs; chs = new char(10);
  • char chs; chs = char[10];
  • char chs[10];
  • char chs[] = new char[10];

Questão 101

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

Questão 102

Questão
102. How to get whole string in one line (in command line)?
Responda
  • string s; getline(cin, s);
  • string s; getline(cout, s);
  • string s; cin >> s;
  • string s; cout << s;

Questão 103

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

Questão 104

Questão
104. Why do we need library?
Responda
  • To work with strings.
  • To work with files.
  • To work with mathematical functions.
  • To work with our own libraries.

Questão 105

Questão
105. Why do we need library <cmath>?
Responda
  • To work with strings.
  • To work with mathematical functions.
  • To work with command line.
  • To work with our own libraries.

Questão 106

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

Questão 107

Questão
107. What will be printed in the part of the cod?
Responda
  • 1 4 7 10
  • 0 3 6 9
  • 3 6 9
  • 9 6 3 0

Questão 108

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

Questão 109

Questão
109. Which of the following is the proper keyword to allocate memory?
Responda
  • new
  • malloc
  • create
  • value

Questão 110

Questão
110. Which of the following is the proper keyword to deallocate memory?
Responda
  • free
  • delete
  • clear
  • remove

Questão 111

Questão
111. Assume if A = 10; and B = 15; with using bitwise OR operator Find A||B
Responda
  • 10
  • 15
  • 61
  • 13

Questão 112

Questão
112. The notation of logical NOT operator in a C++ program is
Responda
  • !
  • :
  • ;
  • None of above

Questão 113

Questão
113. Which of the following denote C++ looping statement?
Responda
  • All of them
  • for
  • while
  • do-while

Questão 114

Questão
Cin in C++ program uses the operator
Responda
  • >>
  • <<
  • >
  • ||

Questão 115

Questão
What is the minimum number of times a do loop would definitely get executed?
Responda
  • 1
  • inf
  • 0
  • None of the above

Questão 116

Questão
The function named as exforsys declared as int exforsys(float x, double y) has return type as
Responda
  • int
  • char
  • double
  • string

Questão 117

Questão
Which of the following is mandatory for all C++ program?
Responda
  • main()
  • void()
  • system()
  • None of the above

Questão 118

Questão
Which of the following denote newline character in C++ program?
Responda
  • “\n”
  • end
  • “/n”
  • enl

Questão 119

Questão
Which of the following is used to group a set of objects and functions under a name?
Responda
  • namespace
  • name
  • namearea
  • areaname

Questão 120

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

Questão 121

Questão
What is the notation used show the size of array?
Responda
  • [ ]
  • { }
  • ( )
  • " "

Questão 122

Questão
How many values can be returned by a C++ function?
Responda
  • 1
  • Inf
  • 0
  • None of the above

Questão 123

Questão
123. Which of the following is returned by the system if a C++ program completes successfully?
Responda
  • 0
  • 1
  • -1
  • Inf

Questão 124

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

Questão 125

Questão
125. Comments in C++ program is written by using
Responda
  • //
  • --
  • <!-->
  • <>

Questão 126

Questão
126. The array exforsys[10] can be declared using pointers as
Responda
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Questão 127

Questão
127. Default size of int in c++ (in bytes)
Responda
  • 4
  • 8
  • 16
  • 2

Questão 128

Questão
128. Default size of double in c++ (in bytes)
Responda
  • 16
  • 8
  • 4
  • 2

Questão 129

Questão
129. Default value of boolean
Responda
  • false
  • true

Questão 130

Questão
130. If a function in C++ does not return a value then its return type is denoted as
Responda
  • void
  • int
  • double
  • bool

Questão 131

Questão
131. A user defined header file is included by following statement in general.
Responda
  • #include "file.h"
  • #include <file.h>
  • #include file.h
  • #include <file>

Questão 132

Questão
132. An inline function can execute faster than a normal function.
Responda
  • True
  • False

Questão 133

Questão
133. What value must a destructor return?
Responda
  • 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

Questão 134

Questão
134. What character ends all strings?
Responda
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Questão 135

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

Questão 136

Questão
136. Which of the following functions compares two strings?
Responda
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Questão 137

Questão
137. Which of the following adds one string to the end of another?
Responda
  • strcat();
  • append();
  • stradd();
  • stringadd();

Questão 138

Questão
138. Which of the following correctly declares an array?
Responda
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Questão 139

Questão
139. What is the index number of the last element of an array with 29 elements?
Responda
  • 28
  • 29
  • 0
  • 27

Questão 140

Questão
140. Which of the following is a two-dimensional array?
Responda
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Questão 141

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

Questão 142

Questão
142. Which of the following accesses a variable in structure b?
Responda
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Questão 143

Questão
143. Which of the following accesses a variable in structure *b?
Responda
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Questão 144

Questão
144. Which of the following is a properly defined struct?
Responda
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Questão 145

Questão
145. Which properly declares a variable of struct foo?
Responda
  • foo var
  • struct foo
  • foo
  • int foo

Questão 146

Questão
146. Which of the following is the proper declaration of a pointer?
Responda
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Questão 147

Questão
147. Which of the following gives the memory address of integer variable a?
Responda
  • &amp;a;
  • *a;
  • address(a);
  • a;

Questão 148

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

Questão 149

Questão
149. Which of the following is the proper keyword to allocate memory?
Responda
  • new
  • malloc
  • create
  • value

Questão 150

Questão
150. Which of the following is the proper keyword to deallocate memory?
Responda
  • delete
  • clear
  • remove
  • free

Questão 151

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

Questão 152

Questão
152. What is the notation used show the size of array?
Responda
  • [ ]
  • { }
  • ( )
  • " "

Questão 153

Questão
153. How many values can be returned by a C++ function?
Responda
  • 1
  • Inf
  • 0
  • None of the above

Questão 154

Questão
154. Which of the following is returned by the system if a C++ program completes successfully?
Responda
  • 0
  • 1
  • -1
  • Inf

Questão 155

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

Questão 156

Questão
156. Comments in C++ program is written by using
Responda
  • //
  • --
  • <!-->
  • <>

Questão 157

Questão
157. The array exforsys[10] can be declared using pointers as
Responda
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Questão 158

Questão
158. Default size of int in c++ (in bytes)
Responda
  • 4
  • 8
  • 16
  • 2

Questão 159

Questão
159. Default size of double in c++ (in bytes)
Responda
  • 16
  • 8
  • 4
  • 2

Questão 160

Questão
160. Default value of boolean
Responda
  • false
  • true

Questão 161

Questão
161. If a function in C++ does not return a value then its return type is denoted as
Responda
  • void
  • int
  • double
  • bool

Questão 162

Questão
162. A user defined header file is included by following statement in general.
Responda
  • #include “file.h”
  • #include <file.h>
  • #include file.h
  • #include <file>

Questão 163

Questão
163. An inline function can execute faster than a normal function.
Responda
  • True
  • False

Questão 164

Questão
164. What value must a destructor return?
Responda
  • 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

Questão 165

Questão
165. What character ends all strings?
Responda
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Questão 166

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

Questão 167

Questão
167. Which of the following functions compares two strings?
Responda
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Questão 168

Questão
168. Which of the following adds one string to the end of another?
Responda
  • strcat();
  • append();
  • stradd();
  • stringadd();

Questão 169

Questão
169. Which of the following correctly declares an array?
Responda
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Questão 170

Questão
170. What is the index number of the last element of an array with 29 elements?
Responda
  • 28
  • 29
  • 0
  • 27

Questão 171

Questão
171. Which of the following is a two-dimensional array?
Responda
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Questão 172

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

Questão 173

Questão
173. Which of the following accesses a variable in structure b?
Responda
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Questão 174

Questão
174. Which of the following accesses a variable in structure *b?
Responda
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Questão 175

Questão
175. Which of the following is a properly defined struct?
Responda
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Questão 176

Questão
176. Which properly declares a variable of struct foo?
Responda
  • foo var
  • struct foo
  • foo
  • int foo

Questão 177

Questão
177. Which of the following is the proper declaration of a pointer?
Responda
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Questão 178

Questão
178. Which of the following gives the memory address of integer variable a?
Responda
  • &a;
  • *a;
  • address(a);
  • a;

Questão 179

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

Questão 180

Questão
180. Which of the following is the proper keyword to allocate memory?
Responda
  • new
  • malloc
  • create
  • value

Questão 181

Questão
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 --);
Responda
  • 26
  • 24
  • 22
  • 28

Questão 182

Questão
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);
Responda
  • 6
  • 5
  • 1
  • 4

Questão 183

Questão
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++);
Responda
  • 9
  • 10
  • 8
  • 4

Questão 184

Questão
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);
Responda
  • 10
  • 9
  • 4
  • 8

Questão 185

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

Questão 186

Questão
184. ……………….. are used to document a program and improve its readability.
Responda
  • Comments
  • Keywords
  • Control structures
  • Blocks

Questão 187

Questão
185. Members of a class specified as ……………….. are accessible only to methods of that class. 
Responda
  • private
  • public
  • protected
  • none of them

Questão 188

Questão
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 --);
Responda
  • 24
  • 21
  • 22
  • 28

Questão 189

Questão
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++);
Responda
  • 2
  • 1
  • Syntax error
  • 3

Questão 190

Questão
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++);
Responda
  • 4
  • 5
  • 8
  • 2

Questão 191

Questão
189. Identify, from among the following, the incorrect variable name
Responda
  • 2ndName
  • _theButton
  • my2ndFont.
  • CurrentWeatherStateofplanet

Questão 192

Questão
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
Responda
  • Both i and ii
  • all of them
  • none of them
  • only i

Questão 193

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

Questão 194

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

Questão 195

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

Questão 196

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

Questão 197

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

Questão 198

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

Questão 199

Questão
196. Constructors are used to
Responda
  • Initialize a newly create object.
  • Free memory
  • To create a subclass
  • To build a user interface

Questão 200

Questão
197. Syntax of loop for (declaration; condition; increment/decrement){}
Responda
  • False
  • True

Semelhante

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