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!!");
}}
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
how to write a program that counts automorphic number from 1 to 999
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"); } } } }
#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(); }
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 c++ program to convert binary number to decimal number by using while statement
how to write a program that counts automorphic number from 1 to 999
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 i use the letters look, say, cover, write, cheak
Write a program to convert a 2-digit BCD number into hexadecimal
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
#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(); }
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 c++ program to convert binary number to decimal number by using while statement
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 c++program by using if statement to read a number and check whether it is positive or negative
pongada punda vayanungala ..................