Java
T
point
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Android
Interview Q
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Question 1
:
Assume that you need to write a JSP page that adds numbers from one to ten, and then print the output.
<% int sum = 0;
for(j = 0; j < 10; j++) { %>
// XXX --- Add j to sum
<% } %>
// YYY --- Display ths sum
Which statement when placed at the location XXX can be used to compute the sum. Select the one correct statement
1.
<% sum = sum + j %>
2.
<% sum = sum + j; %>
3.
<%= sum = sum + j %>
4.
<%= sum = sum + j; %>