Find the Output:
int arr [] ={10,5,6,7,8}
int i;
int s= 0 for(i=0;i<arr. Length;i++) ;
{
System.out.println(arr[i]+1);
s=s+arr[i];
}
System.out.println (s) ;
Plz answer with process
And i will mark u brainliest
Answers
Answered by
1
Answer:
It is a simple program where an array is first created then traversed. The important thing to note is, unlike C++, arrays are first class objects in Java. For example, in the following program, size of array is accessed using length which is a member of arr[] object.
Similar questions