1.

What is the output of this program?

public class output
{
public static void main(String args[])
{
int p[] = {5,6,7,8,9};
int q[] = p;
int sum = 0;
for (int j = 0; j < 4; ++j)
sum += (p[j] * q[j + 1]) + (p[j + 1] * q[j]);
System.out.println(sum);
}
}

A. 400
B. 300
C. 200
D. 100
E. None of these
Answer» B. 300


Discussion

No Comment Found