1.

Write a Java program to input a no. and find out the is automorphism no. or not

Answer»

Class composite{

STATIC void check(INT a)//a is the number to be CHECKED

{int n=0;//n is number of a’s factors

for(int i=1;i<=a;i++){

if(a%i==0)

n++;}

if(n>2)

System.out.println(a+” is a composite number”);

else

System.out.println(a+” is a prime number”);

}}

Hope this HELPS.



Discussion

No Comment Found