GoConqr has a new look! Let us know what you think.

Notes

Sequência  fibonacci

Gabriel Rocha JSP Portuguese 1 page

Content of the notes (1)

Page 1

HTML

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>

</head>

<body>

<h1>Tabuada</h1>

<form action="tabuada.jsp">

Insira um número:<br>

<input type="text" name="num" placeholder="número">

<br> <br><br>

<input type="submit" value="Submit">

</body>

</html>

JSP

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Page</title>

</head>

<body>

<h1>Resultado</h1>

<%

String n1 = request.getParameter("num");

int n ;

n = Integer.parseInt(n1);

int num1 = 1, num2 = 0;

out.println(num2);

out.println(num1);

for(int i = 0; i < n; i++){

num1 = num1 + num2;

num2 = num1 - num2;

out.println(num1);

}

%>

</body>

</html>

Information

Description
Sequência fibonacci simples utilizando jsp
Created by
Gabriel Rocha · Aug 2017
Updated
Aug 29, 2017
Views
68
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?