answersLogoWhite

0

write a program in Java to find krishnamurti numbers( generally the logic of such questions is given in the question paper...i don't remember the logic , but i had written a program on this )

class krishnomurti

{

public static void main(int n)

{

int d,c,f=1,i,s=0;

c=n;

while(n>0)

{

d=n%10;

n=n/10;

for(i=1;i<=d;i++)

{

f=f*i;

}

s=s+f;

f=f/f;

d=d*0;

}

if(c==s)

{

System.out.println("yes");

}

else

{

System.out.println("no");

}

}

}

User Avatar

Wiki User

13y ago

What else can I help you with?