# Give the output of the following:

``````
int m[] = {2,4,6,8};
System.out.println(m[1] + " " + m[2]);
``````

87 Likes

# Give the output of the following:

``````
int a[] ={2,4,6,8,10};
a[0]=23;
a[3]=a[1];
int c= a[0]+a[1];
System.out.println("Sum = "+c);
``````

94 Likes

# Give the output of the following:

``````
int a[4]={2,4,6,8};
for(i=0;i<=1;i++)
{
s=a[i]+a[3-i];
System.out.println(s);
}
``````

81 Likes

# Give the output of the following:

``````
int a[]=new int [5];
a[0]=4; a[1]=8; a[2]=7; a[3]=12; a[4]=3;
System.out.println(a[2+1]);
``````

85 Likes

# Give the output of the following program segment:

``````int n[] ={1,2,3,5,7,9,13,16};
double a=Math.pow(n[4], n[1]);
double b=Math.sqrt(n[5]+n[7]);
System.out.println("a=" + a);
System.out.println("b=" + b);
``````

20 Likes

# Give the output of the following program segment:

``````int x[] = {4, 3, 7, 8, 9, 10};
int p = x.length;
int q = x[2] + x[5] * x[1];
System.out.println("p=" + p);
System.out.println("q=" + q);
``````

13 Likes

35 Likes

# Predict the output of the following Java program snippet:

``````System.out.println(Math.floor(-4.7));
``````

25 Likes

# Predict the output of the following Java program snippet:

``````System.out.println(Math.max(Math.ceil(14.55),15.5));
``````

33 Likes

# Predict the output of the following Java program snippet:

``````System.out.println(Math.rint(-9.4)+Math.sqrt(9.0));
``````