What will be the output of the following Java program?
public class evaluate
{
public static void main(String args[])
{
int a[] = {1,2,3,4,5};
int d[] = a;
int sum = 0;
for (int j = 0; j < 3; ++j)
sum += (a[j] * d[j + 1]) + (a[j + 1] * d[j]);
System.out.println(sum);
}
}
38
39
40
41
Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api
# | Quiz |
---|---|
1
Discuss
|
Which of these is long data type literal?
Solution |
2
Discuss
|
What will be the output of the following Java program?
Solution |
3
Discuss
|
Which of these can be returned by the operator &?
Solution |
4
Discuss
|
What will be the output of the following Java program?
Solution |
5
Discuss
|
Which of these can not be used for a variable name in Java?
Solution |
6
Discuss
|
What will be the output of the following Java program?
Solution |
# | Quiz |
Copyright © 2020 Inovatik - All rights reserved