Wednesday, April 15, 2009

Exercises 5 lab 1

Write a program using JSP to display the message “Hello” ten times. The message should be displayed in blue. In addition, display the count with each “Hello” message.

Solution:
<html>
<head>
<title>Welcome to our Website</title>
</head>
<body>
<%
for(int num=0;num<=10;num++)
{
out.println("Hello" + num + "<br>");
}
%>
</body>
</html>
The output of the program is as shown in Figure 2.6.

Figure 2.6: Output of Number.jsp

0 nhận xét: