O Level Exam : Practical Question
📝 HTML
🎨 CSS
⚡ Java Script
<!DOCTYPE html> <html> <head> <title>Multiplication Table</title> </head> <body> <h2>Multiplication Table Generator</h2> <input type="number" id="num" placeholder="Enter a number"> <button onclick="showTable()">Show Table</button> <div id="result"></div> <script> function showTable() { let n = document.getElementById("num").value; let output = ""; for (let i = 1; i <= 10; i++) { output += n + " x " + i + " = " + (n * i) + "<br>"; } document.getElementById("result").innerHTML = output; } </script> </body> </html>
▶ Run Code
🖥 Output: