Automorphic Number Program in Java3 May 2025 | 3 min read In this section, we will learn automorphic numbers with examples and also create Java programs that check whether the number is automorphic or not. What is an automorphic number?A number is called an automorphic number if and only if the square of the given number ends with the same number itself. For example, 25, 76 are automorphic numbers because their square is 625 and 5776, respectively and the last two digits of the square represent the number itself. Some other automorphic numbers are 5, 6, 36, 890625, etc. ![]() How to find automorphic number?Follow the steps given below:
Java Automorphic Number ProgramAutomorphicNumberExample1.java Output 1: Automorphic Not Automorphic Let's see another logic to check the number is automorphic or not. AutomorphicNumberExample2.java Output 1: Enter a number to check: 625 625 is an automorphic number. Output 2: Enter a number to check: 312 312 is not an automorphic number. Let's create a Java program that determines all the automorphic numbers within a specified range. AutomorphicNumberExample3.java Output: Enter the starting value: 1 Enter the ending value: 10000 Automorphic numbers between 1 and 10000 are: 1 5 6 25 76 376 625 9376 |
Java program to print the following pattern on the console Algorithm: STEP 1: START STEP 2: DEFINE i, j STEP 3: SET n=6 STEP 4: SET i=n. REPEAT STEP 5 to STEP 7 UNTIL i>0. STEP 5: SET j=0. REPEAT STEP 6 UNTIL j STEP 6: PRINT * and SET j=j+1 STEP...
2 min read
In this section, we will learn what is tech number and how can we find tech numbers through a Java program. Tech Number 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...
3 min read
In this program, we create a circular linked list, then traverse the list in the reverse order and print the nodes. Algorithm Define a Node class which represents a node in the list. It has two properties data and which will point to the node. Define...
7 min read
In this program, we need to display the upper triangular matrix. Upper Triangular Matrix Upper triangular matrix is a square matrix in which all the elements below the principle diagonal are zero. To find the upper triangular matrix, a matrix needs to be a square matrix that...
4 min read
In the world of computer science, searching algorithms are fundamental techniques for retrieving information from data structures. One of the simplest and most intuitive searching algorithms is the linear search. Linear search is used to search a key element from multiple elements. Linear search is...
4 min read
In this program, we will find out the smallest node in the given binary tree. We first define variable min that will hold root's data. Then, we traverse through left sub-tree to find the smallest node in left subtree. Compare it with min and store...
5 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 discuss...
5 min read
Duck number is another special positive non-zero number that contains zero in it. The digit zero should not be presented at the starting of the number. Zero can be present at any of the positions except the beginning of the number. Let's understand some examples of Duck...
3 min read
In this section, we will learn what is a sphenic number and also create Java programs to check if the given number is sphenic or not. The sphenic number program frequently asked in Java coding tests and academics. Sphenic Number A positive integer n is called a sphenic...
4 min read
In this program, we need to calculate the sum of all the elements of an array. This can be solved by looping through the array and add the value of the element in each iteration to variable sum. Sum of all elements of an array is...
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