Tech Number in Java
In this section, we will learn what is tech number and how can we find tech numbers through a Java program.
A number is called a tech number if the given number has an even number of digits and the number can be divided exactly into two parts from the middle. After equally dividing the number, sum up the numbers and find the square of the sum. If we get the number itself as square, the given number is a tech number, else, not a tech number. For example, 3025 is a tech number.
Tech Number Example
Let's take an example and check 2025 and 1312 are tech numbers or not.
Steps to Find Tech number
The base condition to check the tech number is that the number must contain an even number of digits. If so, we will move to the next step, else will not execute the code further. Let's see the steps.
Tech Number Java Program
Let's create a Java program and check whether the number is tech or not.
Enter a number to check: 2025 2025 is a tech Number.
Enter a number to check: 9181 9181 is not a tech number.
Let's find all the tech numbers between a specified range.
Tech numbers between 1 to 1000000 are: 1 2025 3025 9801 10000
Let's see another logic for the same.
Enter the number to check: 3025 The given number is a tech number.
Next TopicJava HTTP Proxy Server