-
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);
}
}
-
- 400
- 300
- 200
- 100
- None of these
Correct Option: A
400