Tech Number in Java3 May 2025 | 3 min read In this section, we will learn what is tech number and how can we find tech numbers through a Java program. Tech NumberA 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 ExampleLet's take an example and check 2025 and 1312 are tech numbers or not. ![]() Steps to Find Tech numberThe 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 ProgramLet's create a Java program and check whether the number is tech or not. TechNumberExample1.java Output 1: Enter a number to check: 2025 2025 is a tech Number. Output 2: Enter a number to check: 9181 9181 is not a tech number. Let's find all the tech numbers between a specified range. TechNumberExample2.java Output: Tech numbers between 1 to 1000000 are: 1 2025 3025 9801 10000 Let's see another logic for the same. TechNumberExample3.java Output: Enter the number to check: 3025 The given number is a tech number. |
Java program to print the following pattern *000*000* 0*00*00*0 00*0*0*00 000***000 Algorithm: STEP 1: START STEP 2: SET lines=4 STEP 3: Define i, j STEP 4: SET i =1 STEP 5: REPEAT STEP 6 to 15 UNTIL i <= lines STEP 6: SET j=1 STEP 7: REPET STEP 8 and 9 UNTIL j <= lines STEP 8: IF...
2 min read
It is a problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going to solve...
13 min read
? In Java programming, we often required to generate random numbers while we develop applications. Many applications have the feature to generate numbers randomly, such as to verify the user many applications use the OTP. The best example of random numbers is dice. Because when we throw...
7 min read
Palindromes are fascinating linguistic constructs that have intrigued minds for centuries. In simple terms, a palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward. In the realm of programming, creating a program to determine whether a...
9 min read
In this section, we will learn what is an autobiographical number and also create Java programs to check if the given number is autobiographical or not. The autobiographical number program frequently asked in Java coding tests to check the logic of the programmer. Autobiographical Number A digit count...
4 min read
In this program, we need to find the most repeated word present in given text file. This can be done by opening a file in read mode using file pointer. Read the file line by line. Split a line at a time and store in...
4 min read
Java String to Date We can convert String to Date in java using parse() method of DateFormat and SimpleDateFormat classes. To learn this concept well, you should visit DateFormat and SimpleDateFormat classes. Java String to Date Example Let's see the simple code to convert String to Date in java. import java.text.SimpleDateFormat; import...
2 min read
Java Convert Timestamp to Date We can convert Timestamp to Date in java using constructor of java.util.Date class. The constructor of Date class receives long value as an argument. So, you need to convert Timestamp object into long value using getTime() method of java.sql.Timestamp class. Let's see the constructor...
2 min read
Program to print the largest element in an array In this program, we need to find out the largest element present in the array and display it. This can be accomplished by looping through the array from start to end by comparing max with all the...
2 min read
Java program to print the following pattern on the console In this program, we are creating a right-angled triangle of numbers in increasing order. We are creating two loops, and 2nd loop is executing according to the first loop, inside 2nd loop printing the number row-wise...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India