Java Automorphic number program 2 Answer(s) 5 years and 2 months ago
Posted in : Java Beginners
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
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 - Java Beginners JavaAutomorphicnumber program Write a program to read a positive...){
if ((n*n) % d == n){
System.out.println("AutomorphicNumber");
}
else{
System.out.println("Not AutomorphicNumber
How to Check Automorphic Number using Java Program
How to Check AutomorphicNumber using JavaProgramAutomorphic numbers... whose square ends with the given integer. For example,5 is an automorphicnumber.... Similarly 6 is an automorphicnumber as the square of 6 is 36 and its square consists
Advertisements
automorphic no automorphic no write a program in java to find all the automorphic no's from 10 to 1000
automorphic numbers automorphic numbers how to find automorphicnumber in java
Hi Friend,
Pleas visit the following link:
Automorphic numbers
Thanks
Java Find Automorphic numbers Java Find Automorphic numbers
In this section, you will learn how to find... square ends with the given integer. For
example,5 is an automorphicnumber... is an automorphicnumber as the
square of 6 is 36 and its square consists
Magic number Java Program
Magic numberJava 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
Prime Number program in Java
Prime Numberprogram 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... program in Java:
package Tutorial;
public class PrimeNumber {
public static
Prime number program in java
Prime numberprogram 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
Check Perfect Number in Java Program
How to Check Perfect Number in JavaProgram
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
ID number program
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
The Array Palindrome Number in Java
The Array Palindrome Number in Java
This is a Java simple palindrome numberprogram... program. The
array palindrome number arrange the array number. This session
Prime Number in Java
Prime Number in Java
In this Java tutorial , you will learn how to write a
Javaprogram to get
prime numbers between 1 to the desired number.
To start... prime number.
ADS4ThUnitADS
Here is the code of the javaProgram to get prime
java - Java Beginners
java Write a Javaprogram to read a positive integer from console and find out whether it is automorphic or not.(Automorphicnumber are those which...){
if ((n*n) % d == n){
System.out.println("AutomorphicNumber");
}
else
number of stairs - Java Beginners 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
getting random number in java
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
Magic number in java
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
Number Convert - Java Beginners
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
prime number - Java Beginners
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
prime number - Java Beginners
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
add number - Java Beginners
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 java program Write a javaprogram to find the number of
Positive numbers in m* n matrix
perfect number - Java Beginners
perfect number An integer number is said to be a perfect number.... For example, 6 is a perfect number because 6 = 1+2+3. Write a method perfect that determines if parameter number is a perfect number. Use this method
A program to find the sum of odd number
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
a Java program
a Javaprogram
Write a Javaprogram to print even numbers from 2 to 1024?
Write a Javaprogram to print ? My Name is Mirza? 100 times?
Write a Javaprogram to print Fibonacci Series?
Write a Javaprogram to reverse a number
GUESS NUMBER - Java Beginners
GUESS NUMBER Create a guessing game that picks a random number...() {
super("Guess Number");
randomNumber = new Random().nextInt(100) + 1...);
panelBottom.add(comment, BorderLayout.SOUTH);
panel.add(new JLabel(" Guess a number from
Convert Number to Roman Number Using Java Java Convert Number to Roman Numerals
In this section, you will learn how to convert the number to roman
number. To do this, we have created a class... and the method convertIntegerToRoman(int n)
convert the specified number into roman
java program 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 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 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 reverse number Java reverse number
In this tutorial, you will learn how to reverse a number in java.
In java, you can use arithmetic operators like division operator(/) and
remainder operator(%) to reverse the number. The division operator returns
Write a program to calculate factorial of any given number program
to calculate factorial of any given number. First of all define a class... in java.
Here is the code of program:
import ... Factorial Examples - Java Factorial Example to calculate factorial of any
JAVA program - Java Beginners JAVA program Write a JAVAprogram to accept a number and find whether it is a magic number
JAVA program - Java Beginners JAVA program Write a JAVAprogram to accept a number and find whether it is a magic number
Java Program - Java Beginners Java Program Write a javaprogram to find out the sum of n-number of digits of a given number by the user
java number to word - Java Beginners javanumber to word Can somebody please fix this to come out with the word, not the number 23?
import java.util.Scanner;
public class... " +
"position followed by 5 integers \nspecifying the number
java program 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