Explain the error in the following code. You may give the warning message, or error message, your compiler might give for the following error, or you may describe the error. However you present the error, you must explain clearly what is wrong.

```
#include
//Test question
void show_array(int ar[], int size)
{using namespace std;
for(int i = 0; i < size; i++}
cout << ar {i} << '' '' }
int main()
{const int a[6] = {2, 4, 2, 3, 5};
show_array(a, 6); //...
```

```
void show_array(int ar[], int size)
{ //^^^^ should be const to use a as an
//argument.
//. . .
}

show_array(a, 6);//warning: pointer to const given for
//argument 1 of 'void show_array(int*, int)
```

Computer Science & Information Technology

You might also like to view...

The horizontal placement of text is referred to as ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

The oscillations in a signal lying on a network can also be quantified by the number of zero crossings in the signal values. If there is a directed edge from node i to node j and there is a change in the sign of the signal values at nodes i and j, then it is counted as one zero crossing. Create a directed random network with 300 nodes by adding a directed edge between any two nodes with a probability of 0.15.

(a) Plot the number of zero crossings separately in real and imaginary parts of the eigenvectors of the in-degree Laplacian matrix with respect to the magnitudes of the corresponding eigenvalues. Comment on your observations and explain the frequency ordering. (b) Repeat part (a) for the weight matrix of the network.

Computer Science & Information Technology