C++ Programming - References - Discussion
Discussion Forum : References - Programs (Q.No. 12)
12.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int arr[] = {1, 2 ,3, 4, 5};
int &zarr = arr;
for(int i = 0; i <= 4; i++)
{
arr[i] += arr[i];
}
for(i = 0; i <= 4; i++)
cout<< zarr[i];
return 0;
}
Discussion:
11 comments Page 2 of 2.
Waqar Akram said:
5 years ago
@Manish maybe you are right. But if we use int &zarr=arr[5] it will show the next error (i is not initialized).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers