1.

Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array. int a = new int (5); for (int i = 0; i < = 5; i++) a [i] = i;

Answer»

The corrected code is int [ ] a = new int [5]; 

for(int i = 0; i < = 4; i++) 

a[i]=i; 

}



Discussion

No Comment Found

Related InterviewSolutions