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 to write a program that counts automorphic number from 1 to 999
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!!"); }}
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 lex program to delete space from the program
How to write a program for mouse in microprocessor?
how to write a program that counts automorphic number from 1 to 999
VBnet program to find the prime numbers between 100 to 200?
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!!"); }}
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
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.
All of the whole numbers between one and a billion. Honestly, we're not robots here. Write a program and do it yourself, if you really need them.
write a lex program to delete space from the program
write an assembly language program to find sum of N numbers
write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html
fdsgfhgdfhgdf
How to write a program for mouse in microprocessor?
for (int i = 2; i < 10; i ++) printf("%d\n", i); You did say even and odd numbers between 1 and 10. That's allnumbers between 1 and 10.