Menu

(Solved) : 51 Following Code Segment Accepted Syntax Error Int B 5 10 15 Auto Begin B End B Cout Q38187891 . . .

51. The following code-segment is accepted with nosyntax-error:

int b[] {5, 10, 15};
for(auto i = begin(b); i != end(b); ++i)   
cout << ” ” << *i;
  
  
T__ F__   

52. The following code-segment is logically incorrect:

char c[10] {“abcd”};   
char *cPtr{ c };   
cout << “Array address = ” << c << endl;
  
T__ F__

53. The following code-segment is accepted with no error:

const size_t SIZE{3};
array<int, SIZE>arr = {11, 22, 33};

cout << *(arr.begin() + 1) << ” ”   
<< *(arr.end() – 1) << endl;   

T__ F__

54. The following function header

void Average(double* arr, int count)

does not agree with the function call that passes aC-array
called values, of type double:

Average(values, sizeof(values));
  
T__ F__

55. The following C++ array

const int SIZE = 3;
array<int, SIZE> arr = {};   

is initialized to 0.

T__ F__

56. The following declaration

array<int> a = { 1, 2, 3 };

is syntactically correct.

T__ F__   
  

57. The following code-segment is syntactically correct:

const int SIZE = 3;
array<int, SIZE> arr1 = {9, 8, 7};
array<int, SIZE> arr2 ;
arr2 = arr1;   

T__ F__

58. The following code-segment is syntactically correct

array<int, 5> myarray = { 2, 16, 77, 34, 50 };
cout << “myarray contains:”;
for ( auto i = begin( myarray ); i != end( myarray ); ++i )
cout << ” ” << *i;

T__ F__
  
59. The following ‘range for’ can’t be implemented, for theabove
array, using ‘auto’:

for (auto i : myarray)
cout << i << ” “;   

T__ F__

60. The following array-allocation is syntactically illegal:

size_t inputNums{20};
int* p = new int [inputNums];
  
T__ F__

Expert Answer


Answer to 51 Following Code Segment Accepted Syntax Error Int B 5 10 15 Auto Begin B End B Cout Q38187891 . . .

OR