View Answers

June 13, 2009 at 4:21 PM

Hi Friend,

Try the following code:

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");

}

}

}

}

Thanks

Try the following code:

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");

}

}

}

}

Thanks

January 13, 2011 at 11:37 AM

Write a Program in java to find the all automorphic no's from 10 to 1000?

Related Tutorials/Questions & Answers:

Java Automorphic number program Write a program to read a positive...){ if ((n*n) % d == n){ System.out.println("Automorphic Number"); } else{ System.out.println("Not Automorphic Number

How to Check Automorphic Number using Java Program Automorphic numbers... whose square ends with the given integer. For example,5 is an automorphic number.... Similarly 6 is an automorphic number as the square of 6 is 36 and its square consists

Advertisements

automorphic no write a program in java to find all the automorphic no's from 10 to 1000

automorphic numbers how to find automorphic number in java Hi Friend, Pleas visit the following link:ADS_TO_REPLACE_1 Automorphic numbers Thanks

Magic number Java Program write a program that guesses what number the user is thinking of. Below is a sample transcript: Think of a number between 1 and 255. I will guess the number you are thinking of. 1 3 5 7 9 11 13 15 17

program on factorial of a given number in java please tell me, how to write program on factorial of a given number in java

program on factorial of a given number in java please tell me, how to write program on factorial of a given number in java

Prime Number program in Java will print the prime numbers between 1 to any given number. Prime Number is a number that is not divisible by any number other... of Prime Number program in Java: package Tutorial; public class PrimeNumber

Java Find Automorphic numbers In this section, you will learn how to find... square ends with the given integer. For example,5 is an automorphic number... is an automorphic number as the square of 6 is 36 and its square consists

Write a program in Java to convert Decimal number into Binary number Hi, I have decimal number and I want to convert it to Binary. How to Write a program in Java to convert Decimal number into Binary number? Thanks

Prime number program in java In this example you will learn how to write a program to generate and check prime number in java. As we know prime number are those number which are divisible by 1 or itself, first define

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to check whether a number is pallindrome or not using recursion??????? java program to check whether a number is pallindrome or not using recursion

java program to insert data into a file and count the number of words from the file??????? java program to insert data into a file and count the number of words from the file

ID number program hi can anyone help me with the following program. a program that can determine a person,s date of birth, age, gender and citizenship by just entering the id number. thanks in advance

How to Check Perfect Number in Java Program A perfect number is a positive... to the number itself. For example 6 is a perfect number as 1,2 and3 are its divisors and the sum of divisors=1+2+3=6. Here we have created a program that will take

write a java program to print marklist of "n " students. input Register number, name and marks of three subjects. write a java program to print marklist of "n " students. input Register number, name and marks of three subjects

write a program in java Adding up the subscript(st,nd,rd,th) to the number of days in a input string write a program in java Adding up the subscript(st,nd,rd,th) to the number of days in a input string ex:If a user enters

The Array Palindrome Number in Java This is a Java simple palindrome number program... program. The array palindrome number arrange the array number. This session

Prime Number in Java In this Java tutorial , you will learn how to write a Java program to get prime numbers between 1 to the desired number. To start... the bytes.ADS_TO_REPLACE_1 In this example of writing java program to get prime

Program to Find Cube Root of any Number without using built in function Please help me in finding cube root of any number without using Built in function in java

A program to find the sum of odd number In this section you will learn how to find the sum of odd number in the series up to the given number in java... number. import java.util.Scanner; public class Sum { public static

program to calculate factorial of any given number. First of all define a class... in the range of double data type in java. Here is the code of program:ADS... Factorial Examples - Java Factorial Example to calculate factorial of any

How to format number in Java? Hi, What is the best way to format a number in Java? How to format number in Java? Thanks Hi, To format number in Java you can use the class java.text.NumberFormat. Here is simple

number of stairs 1. Write a program that prints an n-level stair case made of text. The user should choose the text character and the number...(); } } } ----------------------------------- read for more information, http://www.roseindia.net/java/master

Palindrome program in Java helps programmers to determine if a number.... The logic used in Java program behind finding a number or sting is palindrome.... Example of Palindrome program in Java: import java.io.*; public class

passString(int number){ int num, q ; if (number < 10 ){ displayOutput(a[number...]) ; } if ( number > 19 ){ num = number % 10 ; if ( num == 0 ){ q = number / 10 ; displayOutput (d[q-2]) ; } else{ q = number / 10 ; displayOutput(a[num

Magic number in java Hi.. Can any one tel how to watch a magic number of a program? import java.util.*; class MagicNumber...); System.out.print("Enter the number: "); int num =input.nextInt(); int b=0,x

Program to count the number of unique words in a file using HashMap import java.io.File; import java.io.FileNotFoundException; import java.util....()); System.out.println("The number of unique words: "+uniqueValues.size

getting random number in java getting random number in java Hi... and scaling the random number in my Java Random number eample. but for some reason... to generate the random number in Java Thanks in Advance

java program write a program to read 10 numbers from user and store it in a array. display the maximum n minimum number in the array

java program . Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results

Java program Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results

a Java program Write a Java program to print even numbers from 2 to 1024? Write a Java program to print ? My Name is Mirza? 100 times? Write a Java program to print Fibonacci Series? Write a Java program to reverse a number

java Write a Java program to read a positive integer from console and find out whether it is automorphic or not.(Automorphic number are those which...){ if ((n*n) % d == n){ System.out.println("Automorphic Number"); } else

Collection of Large Number of Java Sample Programs and Tutorials Java Collection Examples Java 6.0 New Features (Collection Framework...; HelloWorld Java Program Simple Java Program

prime number i want to write a code in java that picks prime numbers... boolean isPrime(int number){ boolean isPrime=false; int i=(int) Math.ceil(Math.sqrt(number)); while (i>1

java program write a program that accepts only 3 integer values as command line arguments.print the values enter by the user. handle ArrayIndexOutofbounds exception and number format exception by providing appropriate message

Java program Write a Java program that takes 3 integer numbers from command line and display maximum number. (Use conditional operator) Java display maximum number using conditional operator: import java.util.

prime number this project is to determine if a phone number is a prime number. if the number is a prime number then print a message to the effect. if the number is not a prime number then print the prime factors of the number

java program enter any number and print the number's digits in words. example(enter 123) the output comes(one two three

add number Q. write a programe to add three number. The number input... input=new Scanner(System.in); System.out.println("Enter first number"); int a=input.nextInt(); System.out.println("Enter second number"); int b

java program Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest rate, number of years, loan amount, and displays

Ads