Hi, in this java tutorial we will learn how to check a number in java whether it’s an Automorphic number or not.
what is Automorphic Number?
An automorphic number is a natural number which numbers square ends with the number itself. According to wiki Automorphic number is also known as a Circular number.
So please have a look at the pictorial explanation below. I hope it will help you better to understand.
Source Code For How to Check Automorphic Number in Java
public static void main(String args)
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a number : ");
int inputNumber = scanner.nextInt();
int squareNumber = inputNumber * inputNumber;
// Convert Number To String in easy way
String inputNumberAsString = inputNumber + "";
String squareNumberAsString = squareNumber + "";
System.out.println(inputNumber + " is Automorphic Number");
System.out.println(inputNumber + " is Not an Automorphic number");
Code Output For Automorphic Number in java
Enter a number : 45
45 is Not an Automorphic number
Enter a number : 6
6 is Automorphic Number
Enter a number : 5
5 is Automorphic Number
Enter a number : 76
76 is Automorphic Number
Wow, Great, Now you know how to write a java program to check a number isn’t automorphic or not.
Thanks for visiting our house to learn. Bookmark this website for more great stuff to learn.
I love to explore new technologies. If you like my tutorials please share your thoughts about my work.
Check out my YouTube Channel For Video Tutorials.
To Hire Me Please Contact Me Through Social Media or https:www.amialif.com
If you want to help others by doing donation please Donate To These Charities.
You also can connect with me via social media. Thanks