1.

What is array? Write a program segment to read and print the elements of one dimensional array.

Answer»

Array is a group of similar elements that share a common name. Using ‘for’ loop:

int age [10], i;

for(i=0; i<10; i++) { cin>>age[i];

}

for(i=0;i<10;i++)

cout<<age[i];



Discussion

No Comment Found

Related InterviewSolutions