Created by Gabriel Rocha
about 7 years ago
|
||
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>
Want to create your own Notes for free with GoConqr? Learn more.