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 <iostream>
//Test question
void show_array(int ar[],int size)
{
using namespace std;
for(int i = 0;i < size;i++)
cout << ar[i] << " ";
cout << endl;
}
int main()
{
const int a[6] = {2,4,2,3,5};
show_array(a,6);
//...
}
Correct Answer:
Verified
{ //^...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q17: In a sorting an array,the items in
Q18: In the definition,double d[10] = {0.0};only d[0]
Q19: Describe the difference in the meaning of
Q20: Give the syntax of an array declaration.Mention
Q21: What is the output of the following
Q23: Here is a list of 8 numbers.Use
Q24: Consider the declaration
double a[10] = {1.2,2.1,3.3,3.5,4.5,7.9,5.4,
8.7,9.9,1.0};
Write a
Q25: Given the definition and code fragment: int
Q26: Given the array declaration,int a[20];The first element
Q27: Suppose we want an array to satisfy
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents