to find whether a number is krishnamurthy number or not using java
#1

program for to find wether a no is krishnamurthy or not



















Quote:
Reply
#2

Question 44 : Write a program in Java to check whether the number given by the user is a Krishna Murthy number or not.

Krishna Murthy Number : It is a number which is equal to the sum of the factorials of all its digits.

For example : 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145

Java Program :

import java.io.*;
class krishnamurthy
{
int fact(int n)
{
int i,p=1;
for(i=n;i>=1;i--)
p=p*i;
return p;
}
void krishna()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int a,b,s=0;
System.out.print("Enter the number : ");
a=Integer.parseInt(br.readLine());
System.out.print("\n");
int n=a;
while(a>0)
{
b=a%10;
s=s+fact(b);
a=a/10;
}
if(s==n)
System.out.print(n+" is a krishnamurthy number");
else
System.out.print(n+" is not a krishnamurthy number");
}
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: wap to enter a number and check whether it is krishnamurthy using bufferedreader, krishnamurthy number in php,
Popular Searches: temprature controlfan pptcontact number download, how to find kl lotery prize number, atm number backwards, washington college number, how to find average of 1st 20 multiples of a number, mp samgar i d, www kearala latrry kulu number,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  anna university result technical paper chasing member contact number 20 21,225 19-11-2018, 12:57 PM
Last Post:
  dwt code in java for image 2 6,316 24-03-2018, 10:06 PM
Last Post: Guest
  java programmings for bus ticket reservation source code 1 6,183 09-11-2017, 11:28 PM
Last Post: Ayushi Nagar
  tomorrow kerala lottery result last three number tip 9 10,051 01-11-2017, 05:44 PM
Last Post: Guest
Wink student online counselling simple projects in core java with source code 3 6,781 10-06-2017, 10:21 AM
Last Post: jaseela123d
  government scheme management system in java 2 6,107 26-04-2017, 11:40 PM
Last Post: dumpo
  nadakacheri helpline phone number 2 7,904 17-04-2017, 05:24 PM
Last Post: Guest
Wink smarter electricity billing system source code in java 2 6,244 14-04-2017, 02:36 AM
Last Post: dy52225
Smile auto text summarization source code in java 1 5,766 13-04-2017, 11:07 AM
Last Post: jaseela123d
  how to track acknowledgement number of ration card in bangalore 1 5,882 12-04-2017, 10:47 AM
Last Post: jaseela123d

Forum Jump: