answersLogoWhite

0


Best Answer

Source Code ::

import java.io.*;

class automorphic

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the number: ");

int a=Integer.parseInt(in.readLine()),b=a,c=0,e=a*a;

while(b>0)

{

c++;

b/=10;

}

double d=Math.pow(10,c-1);

if(a==e%d)

System.out.println("Automorphic number!!");

else

System.out.println("Not an Automorphic number!!");

}}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

I have upload the program on the following link, please check the link below:

http://nessarmawlong.blogspot.com/2011/11/automorphic-number-in-java.html

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a Program in java to cheak a number is automorphic number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


Write a program to print automorphic numbers between 1 and 100?

import java.math.*; import java.util.*; class AutomorphicNumber{ static int d=10; public static void main(String args[]){ System.out.print("Enter any number :"); Scanner input=new Scanner(System.in); int n=input.nextInt(); if(d>=n){ if ((n*n) % d == n){ System.out.println("Automorphic Number"); } else{ System.out.println("Not Automorphic Number"); } } else if(d<=n){ d=d*10; if ((n*n) %d==n){ System.out.println("Automorphic Number"); } else{ System.out.println("not an automorphic number"); } } } }


Write a C program to find a given number is automorphic or not?

#include<stdio.h> #include<conio.h> void main() { int s,c,p,n,i,t; printf("Enter a number:"); scanf("%d",&n); s=n*n; c=0; p=1; t=n; while(n!=0) { c++; n=n/10; } for(i=1;i<=c;i++) p=p*10; if(s%p==t) printf("The number is automorphic."); else printf("Not automorphic."); getch(); }


How can you write an algorithm for getting autoformic numbers?

Perhaps you mean an automorphic number? Loop through a series of numbers - for example, all numbers from 1 to 10,000 - and check each of the numbers, whether the condition applies. The condition in this case is that if you square the number, the last digits represent the original number.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement

Related questions

A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


Write a program to print automorphic numbers between 1 and 100?

import java.math.*; import java.util.*; class AutomorphicNumber{ static int d=10; public static void main(String args[]){ System.out.print("Enter any number :"); Scanner input=new Scanner(System.in); int n=input.nextInt(); if(d>=n){ if ((n*n) % d == n){ System.out.println("Automorphic Number"); } else{ System.out.println("Not Automorphic Number"); } } else if(d<=n){ d=d*10; if ((n*n) %d==n){ System.out.println("Automorphic Number"); } else{ System.out.println("not an automorphic number"); } } } }


How can you use the letters look say cover write cheak?

how can i use the letters look, say, cover, write, cheak


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


Write a C program to find a given number is automorphic or not?

#include<stdio.h> #include<conio.h> void main() { int s,c,p,n,i,t; printf("Enter a number:"); scanf("%d",&n); s=n*n; c=0; p=1; t=n; while(n!=0) { c++; n=n/10; } for(i=1;i<=c;i++) p=p*10; if(s%p==t) printf("The number is automorphic."); else printf("Not automorphic."); getch(); }


How can you write an algorithm for getting autoformic numbers?

Perhaps you mean an automorphic number? Loop through a series of numbers - for example, all numbers from 1 to 10,000 - and check each of the numbers, whether the condition applies. The condition in this case is that if you square the number, the last digits represent the original number.


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


Write a C program to convert hexadecimal number into decimal number?

pongada punda vayanungala ..................