int main()
{
int i ,a[i];
i = 0;
a[i] = 10;
cout<< a[i] << endl;
return 0;


}

What will be output of this program?

Answer Posted / vikas

Index variable of any array should be integer constant.
but in this case i is not constant so it is a error

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I run c program in turbo c++?

776


What is c++ and its uses?

888


What is the hardest coding language to learn?

799


Explain what is polymorphism in c++?

862


What is the type of 'this' pointer? When does it get created?

728


What is the use of "new" operator?

889


Is vector a class in c++?

801


What is time h in c++?

864


What is meant by the term name mangling in c++?

724


By using c++ with an example describe linked list?

805


Which sort does c++ use?

806


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

827


When are exception objects created?

800


Explain about vectors in c ++?

792


What is command line arguments in C++? What are its uses? Where we have to use this?

862