Write a program to display ‘t point’ if a number entered by user a multiple of five otherwise print ‘silansoftware’

Here's an example program that displays "t point" if a number entered by the user is a multiple of five, otherwise, it prints "silansoftware" using HTML, CSS, JavaScript, and Python:


1. Create the HTML structure in a file named `multiple.html`:

html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" href="style.css">
		<title>Multiple of Five Checker</title>
	</head>
	<body>
		<div class="container">
			<h1>Multiple of Five Checker</h1>
			<label for="numberInput">Enter a number:</label>
			<input type="number" id="numberInput">
			<button id="checkButton">Check</button>
			<p id="result"></p>
		</div>

		<script src="script.js"></script>
	</body>
</html>

2. Create the CSS styling in a file named `style.css`:

css
body {
	font-family: Arial, sans-serif;
	background-color: #f4f4f4;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
}

.container {
	text-align: center;
	background-color: #fff;
	padding: 20px;
	border-radius: 5px;
	box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}

button {
	padding: 10px 20px;
	background-color: #007bff;
	color: #fff;
	border: none;
	border-radius: 5px;
	cursor: pointer;
}

button:hover {
	background-color: #0056b3;
}

3. Create the JavaScript logic in a file named `script.js`:

javascript
document.addEventListener("DOMContentLoaded", function () {
	const numberInput = document.getElementById("numberInput");
	const checkButton = document.getElementById("checkButton");
	const result = document.getElementById("result");

	checkButton.addEventListener("click", function () {
		const number = parseInt(numberInput.value);

		if (isNaN(number)) {
			result.textContent = "Please enter a valid number.";
			return;
		}

		if (number % 5 === 0) {
			result.textContent = "t point";
		} else {
			result.textContent = "silansoftware";
		}
	});
});

4. Run a Python web server to host the files. Open your terminal and navigate to the directory containing the HTML, CSS, and JavaScript files, then run the following command:

python -m http.server


5. Open your web browser and go to `http://localhost:8000/multiple.html`. You should see the multiple of five checker form. Enter a number and click the "Check" button to see the result.


Ensure you have Python installed on your system and the terminal's working directory is where your HTML, CSS, and JavaScript files are located.


Output:
img

About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc






 PreviousNext