File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # https ://www.facebook.com/permalink.php?story_fbid=1289077461428963&id=100009801635737
2+ # subscribed by jay patel
3+ # java program to find automorphic
4+ import java .util .*;
5+ class Automorphic
6+ {
7+ public static void main (String args []) throws Exception
8+ {
9+ Scanner sc = new Scanner (System .in );
10+ System .out .print ("Enter a Number : " ); // Inputting the number
11+ int n = sc .nextInt ();
12+ int sq = n *n ; // Finding the square
13+
14+ String num = Integer .toString (n ); // Converting the number to String
15+ String square = Integer .toString (sq ); // Converting the square to String
16+
17+ if (square .endsWith (num )) // If the square ends with the number then it is Automorphic
18+ System .out .print (n +" is an Automorphic Number." );
19+ else
20+ System .out .print (n +" is not an Automorphic Number." );
21+ }
22+ }
23+
You can’t perform that action at this time.
0 commit comments