High School Physics + more

Automorphic Number

Automorphic Number Java Program – check if a Number is an Automorphic

This post presents a Java Program to check if a given Number is an Automorphic number. Automorphic number Java Program – code import java.util.Scanner;public class Automorphic {public static void main(String args[]){Scanner sc = new Scanner(;System.out.print(“Input a number : “);int num = sc.nextInt(); int sq_num = num*num;String str_num = Integer.toString(num);String square = Integer.toString(sq_num); if(square.endsWith(str_num))System.out.println(“Automorphic Number.”);elseSystem.out.println(“Not an Automorphic […]

Scroll to top